Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: References to a value of an element in another element?

From: Carl Eric Codere <cecodere@-----.-->
To: Pete Cordell <petexmldev@--------------.--->, xmlschema-dev@--.---
Date: 1/25/2007 7:38:00 PM

--- Pete Cordell <petexmldev@t...> wrote:

> Original Message From: "Carl Eric Codere"
> > Greetings,
> >         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
> > XMLSchema?
> >
> > <xsd:complexType name="Chunk">
> >    <xsd:sequence>
> >      <xsd:element name="size"   type="xsd:integer"/>
> >      <xsd:element name="data"  type="xsd:hexBinary" ?????/>
> >    </xsd:sequence>
> >  </xsd:complexType>
> >
> > The problem is with element "data", how do i specify that its length is 
> > the
> > value "size"???
> 
> I'm afraid this is not possible in XML Schema alone.  Including additional 
> Schematron constraints may be able to help.
> 
> (FWIW - XSD 1.1, that is currently being developed, supports co-constraints
> such as this.  But I'm not sure it would support the type of co-constraint 
> that you require here.)

Greetings,
          What is the section in XML Schema 1.1 draft that explains this
feature? If this feature is not currently possible in XML Schema, what would
syntax would you suggest?

My goal here is to be able to describe binary file formats using XML Schema,
or any other scheman language (such as ASN.1, does ASN.1 this then?)...

Any help would be appreciated...
Carl



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

From mike@s... Fri Jan 26 08:52:34 2007
Received: from lisa.w3.org ([128.30


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent