XML not referencing the XSD, namespacing issue -


this driving me nuts. trying create schema xml document. think pretty close reason, cannot figure out how name namespaces. looked online @ dozen articles , tried visual studio doesn't seem it.

this xml file want create xsd for:

<?xml version="1.0" encoding="utf-8" ?> <data xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="dataautonamespace dataautostructure.xsd" >  <set id="hlm">    <!-- download page -->    <item tag="tabs" value="tabs"/>    <item tag="holdingslisttab" value="holdingslisttab"/>    <item tag="backlink" value="back"/>     <!-- holdings list section -->    <item tag="holdingslist" value="holdingslist"/>    <item tag="subtext" value="subtext"/>    <item tag="format" value="format"/>    <item tag="contents" value="contents"/>    <item tag="holdingsfilename" value="filename"/>    <item tag="filenameheader" value="header"/>    <item tag="textbox" value="textbox"/>    <item tag="inputbox" value="inputbox"/>    <item tag="textbutton" value="textbutton"/>    <item tag="textbutton" value="textbutton"/>   </set> </data> 

and schema have designed xml follows:

<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="dataautonamespace" xmlns="dataautonamespace" elementformdefault="qualified">   <xs:element name="item" type="itemtype">         <xs:unique name="uniqueitem">             <xs:selector xpath="set/item"/>             <xs:field xpath="@tag"/>         </xs:unique>     </xs:element>   <xs:element name="data">     <xs:complextype>       <xs:all>       <xs:element name="set" type ="settype"></xs:element>       </xs:all>     </xs:complextype>   </xs:element>     <xs:complextype name="itemtype">         <xs:attribute name="tag" type="xs:token" use="required"/>         <xs:attribute name="value" type="xs:token" use="required"/>     </xs:complextype>   <xs:complextype name="settype">     <xs:sequence>       <xs:element ref="item" maxoccurs="unbounded"/>     </xs:sequence>     <xs:attribute name="id" type="xs:string" use="required"/>   </xs:complextype> </xs:schema> 

can please guide wrong namespacing? getting 'could not find schema information attribute 'tag'.' , on 'id , 'value'.

also, when check inbound references schema, don't any. want make sure tag attributes unique within xml.

thanks, in advance.

for start declaring elements in dataautonamespace in actual document there no elements namespace found. need declare namespace (& bind namespace prefix) in xml document xmlns.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -