Altova Mailing List Archives
>comp.text.xml Archive Home
>Thread Next - Re: XML Schema Issues
XML Schema Issues
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.