Altova Mailing List Archives


XML Schema Issues

From: vardan <vardanchik2002@-----.--->
To: NULL
Date: 6/27/2007 5:49:00 PM

Hi everyone. I have couple problems with xsd file i'm trying to
create.

first question. is it possible to restrict year input to current year?
I mean i don't want to put
<xs:restriction base="xs:integer">
     <xs:minInclusive value="1900" />
     <xs:maxInclusive value="2007" />
</xs:restriction>
and then i have to change next year to  <xs:maxInclusive value="2008" /
>. is there any way to put getdate() or now()  type functions.

second question. is it possible to make one of elements required or
optional depending on the value of the previous element? I realize i
can use "choice" indicator with 2 different elements, but may be there
is another way to do it.


thirs question is related to second. Is it possible to restrict the
value of the element to the value of the one of previous elements.
like
<xs:element name="id" minOccurs="1" type="xs:integer" />
...
<xs:element name="anotherId" minOccurs="1">
    <xs:simpleType>
         <xs:restriction base="xs:integer">
           <the value of 'anotherId' must be only one of values
entered in 'id' element>
         </xs:restriction>
    </xs:simpleType>
</xs:element>

sorry, if questions sound stupid. i'm new in xml schema.
may be the only way to fix this issues is to deal with them when
parsing xml docs.
thanks in advance for any help.

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.