[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] HELP: XML-Schema - Array and Type Choice?
Dear member, I have two more questions on XML-schema that need your help: 1. Is there any way to represent an array? I know that the schema recommendation does not support this yet. But I want to find a best solution for this if possible. For example, my code has a variable: String title[numberOfTitle], where numberOfTitle is not known as a priori when schema author developed it. The numberofTitle is of type xsd:integer designed in schema, and its value will be given by user in an xml document instance, but when the user supplies this data, schema must validate that the maxOccurs can only be numberOfTitle data items. How to design such an schema? In such a situation, do I have to resort to XPATH? 2. My second question is about type choice. Below is part of my schema: <xsd:element name="DataValue"> <xsd:element name="Data" type="xsd:float" minOccurs="1" maxOccurs="unbounded"/> </xsd:element> But I want more constraints on this schema --- when user supplies the attribute dataType to be "float", the schema will only allow the instance document to supply Data Element to be of type xsd:float; on the other hand, if attribute dataType is "double", the XML document can only supply Data Element of type xsd:double? Many thanks, Risheng
|
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
|