[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Extending Types in xml schema
I'm having problems adding elements to a choose group in the base type, from my new type: Base Type: <xs:complexType name="textBaseType" mixed="true"> <xs:annotation> <xs:documentation> Base class for text based objects, although the schema allows you to use this class directly, DON'T! This is simply a base class- unfortunately xml schema has no way of declaring "private" types (as far as i know). </xs:documentation> </xs:annotation> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="br"/> <xs:element name="p" type="textBaseType"/> <xs:element name="span" type="spanType"/> <xs:element name="ul" type="ulType"/> <xs:element name="table" type="tableType"/> </xs:choice> </xs:complexType> Derived Type: <xs:complexType name="spanType" mixed="true"> <xs:complexContent mixed="true"> <xs:extension base="textBaseType"> <xs:annotation> <xs:documentation/> </xs:annotation> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="li" type="tableType"/> </xs:choice> </xs:extension> </xs:complexContent> </xs:complexType> I understand that this would actually be represented as <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:complexType name="spanType" mixed="true"> <xs:annotation> <xs:documentation/> </xs:annotation> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="br"/> <xs:element name="p" type="textBaseType"/> <xs:element name="span" type="spanType"/> <xs:element name="ul" type="ulType"/> <xs:element name="table" type="tableType"/> </xs:choice> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="li" type="tableType"/> </xs:choice> </xs:sequence> </xs:complexType> </xs:schema> And that is obviously wrong. I have heard substitution groups mentioned but i haven't managed to find any good tutorials (there's only about 1/2 a page in Definitive XML Schema!). Any Tips? Cheers c ==================================== Craig Edmunds Web Developer Comtec (Europe) Ltd ==================================== t: +44 (0)1633 627500 f: +44 (0)1633 627501 e: craig.edmunds@c... w: www.comtec-europe.co.uk 6th Floor Gwent House, Gwent Square Cwmbran, South Wales, NP44 1PL =================================== ************************************************************************ This e-mail and any attachments are strictly confidential and intended solely for the addressee. They may contain information which is covered by legal, professional or other privilege. If you are not the intended addressee, you must not copy the e-mail or the attachments, or use them for any purpose or disclose their contents to any other person. To do so may be unlawful. If you have received this transmission in error, please notify us as soon as possible and delete the message and attachments from all places in your computer where they are stored. Although we have scanned this e-mail and any attachments for viruses, it is your responsibility to ensure that they are actually virus free.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|