W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2007

References to a value of an element in another element?

From: Carl Eric Codere <cecodere@yahoo.ca>
Date: Tue, 23 Jan 2007 12:04:44 -0500 (EST)
To: xmlschema-dev@w3.org
Message-ID: <681807.85181.qm@web30813.mail.mud.yahoo.com>

         I have a simple question, but i am not sure it is possible to
represent  it in XMLSchema, if so any help would be really appreciated.

I have variable-length structure and the length of the 2nd element depends on
the value of the first element. How is it possible to specify this in

<xsd:complexType name="Chunk">
      <xsd:element name="size"   type="xsd:integer"/>
      <xsd:element name="data"  type="xsd:hexBinary" ?????/>

The problem is with element "data", how do i specify that its length is the
value "size"???

Thank you very much,
Carl Eric Codère

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
Received on Tuesday, 23 January 2007 18:43:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:11 UTC