[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML Schema question
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> ></xs:element> > > 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. Cheers Rick Jelliffe
|
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
|