This is how I get it work. 1. Create a schema file xml.xsd, put the following content in it. <?xml version="1.0" encoding="US-ASCII" ?> <schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns="http://www.w3.org/2000/10/XMLSchema" xmlns:x="http://www.w3.org/XML/1998/namespace">
<attribute name="lang" type="language"> </attribute> </schema> 2. Add following import in your schema file <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="somepath/xml.xsd"/> 3. Reference the xml:lang as follow: <complexType name="FreeFormTextType"> <simpleContent> <extension base="string"> <attribute ref="xml:lang"/> <minLength value="1"/> <maxLength value="256"/> </extension> </simpleContent> </complexType> Hope this can help. Benson. -----Original Message----- From: Vadim Solonovich [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 17, 2001 8:04 AM To: [EMAIL PROTECTED] Subject: Need help to understand using external schemas. Dear All ! Could anybody help me understand how can I use the features from XML/Xpath/Xlink/Xpointer or other schemas ? 1.How can I correctly import element definfitions and type declarations from those schemas ? As a a test I've tried to import attribute type xml:lang from XML namespace. The following very simple example failed with the error: Schema error: Globally-declared attributes containing values MUST have "use" present and set to "FIXED" or "DEFAULT" sample.xsd: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd='http://www.w3.org/2000/10/XMLSchema' xmlns:xml='http://www.w3.org/XML/1998/namespace' > <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2000/10/xml.xsd"/> <xsd:element name="faq"> <xsd:complexType> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute ref = "xml:lang" /> </xsd:extension> </xsd:simpleContent> </xsd:complexType> </xsd:element> </xsd:schema> What am i doing wrong ? 2. Which value should I use in schemaLocation attribute for - XLink ? - XPointer ? - XPath ? - other XML related ? Thanks in advance, Vadim Solonovich --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
