- From: marco anyway <marcoanyway@hotmail.com>
- Date: Mon, 26 May 2003 16:27:44 +0000
- To: xmlschema-dev@w3.org
Hi, I'd like to insert an attribute that counts the number of element in a SEQUENCE. Is there a way to do this inside XML Schema? The idea is to verify, during the validation phase of the XML document, if the value of this attribute corresponds to the actual number of elements of the sequence. Example: <xsd: element name = "song" type="xsd:string"/> <xsd:attribute name="songCount" type=???????/> <xsd: element name = "songCollection" > <xsd:complexType> <xsd: sequence> <xsd: element ref=song"/> </xsd: sequence> <xsd:attribute ref="songCount"/> </xsd:complexType> </xsd: element> I'd like that the following XML doc would be validated: <songCollection songCount=3> <song>let me breathe<song/> <song>pull me under<song/> <song>another day <song/> </songCollection> and the following would not: <songCollection songCount=8> <song>let me breathe</song> <song>pull me under</song> <song>another day </song> </songCollection> Thanks to all who can help! Marco _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
Received on Monday, 26 May 2003 12:32:40 UTC