Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Declaring a global ID Attribute

From: Bubba <bubba_wgu_@^-------.--->
To: NULL
Date: 10/6/2007 12:22:00 PM

Hi all,

I've got an XSD file that I need to add support to for an optional ID 
attribute on elements. After many hours of tweaking all that I get to 
work in my XML file is:

<Container id="CT"> <!-- Valid ID declaration -->
    <Stuff id="CT-1">Foo Bar</Stuff> <!-- Invalid ID declaration-->
</Container>

I got this to work by adding an:

<xs:attribute name="id" type="xs:ID"/>
just under by <xs:schema ...> line and then:

<xs:complexType name="Container">
     <xs:sequence>
         <xs:element name="Stuff" type="StuffText" minOccurs="0"/>
     </xs:sequence>
     <xs:attribute name="id"/> <!-- I added this line -->
</xs:complexType>

 From what I've read I can do this by declaring the elements separatley 
but the schema is quite large at over 50K, so I'm guessing there MUST be 
a way to globally declare the use of an optional ID attribute on elements.

If I change the elementFromDefault to "unqualified" I can get the ID to 
work but it then breaks other stuff within the XSD.

Can anyone point me in the right direction here please.

Thanks.


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent