W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2003

[xmlschema-dev] <none>

From: marco anyway <marcoanyway@hotmail.com>
Date: Mon, 26 May 2003 16:27:44 +0000
To: xmlschema-dev@w3.org
Message-ID: <Law12-F51TQGYbXhNoR000168ef@hotmail.com>

I'd like to insert an attribute that counts the number of element in a 
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.


<xsd: element name = "song" type="xsd:string"/>

<xsd:attribute name="songCount" type=???????/>

<xsd: element name = "songCollection" >
  <xsd: sequence>
    <xsd: element ref=song"/>
  </xsd: sequence>
  <xsd:attribute ref="songCount"/>
</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/>

and the following would not:

<songCollection songCount=8>
  <song>let me breathe</song>
  <song>pull me under</song>
  <song>another day </song>

Thanks to all who can help!


The new MSN 8: smart spam protection and 2 months FREE*  
Received on Monday, 26 May 2003 12:32:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:11 UTC