OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] XML Schema question

[ Lists Home | Date Index | Thread Index ]

Wong Chin Shin wrote:

>Ah, I think I found the answer, but would like to post it up for someone
>more knowledgeable to verify. Would this be correct:
><xs:element name="myelement">
>	<xs:complexType>
>		<xs:simpleContent>
>			<xs:extension base="xs:string">
>				<xs:attribute name="myattrib1"
>type="xs:string" />
>				<xs:attribute name="myattrib2"
>type="xs:string" />			</xs:extension>
>		</xs:simpleContent>
>	</xs:complexType>
Actually, you probably don't even need to specify that the element's 
content is xs:string.

If there is a chance that myelement will someday contain subelements, 
*don't* declare it
a string and simpleContent now. If there is a chance that someday you 
will want to refine
the schema further to enforce, say, that myelement has a maximum of 20 
characters, then *do*
declare it a string now.

Rick Jelliffe


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS