|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problems with xs:redefine
Hi, I am having problems with xs:redefine. Schemas that were validated in XML Spy 2004 are coming up as invalid in XML Spy 2005. I don't know if perhaps XML Spy 2004 wasn't looking back to the original schema to make sure that the redefines were valid restrictions of the elements in the original schema? However, when I used the "Generate Sample XML file" from schema function in 2004, it was coming up with valid instances that matched the constraints in my redefining schema it seemed that the schemas must be OK...until I ran into errors using 2005. In the redefining schema I'm trying to a) create enumerated lists for the elements that were simpleTypes in the original schema and b) restrict certain complexTypes so that some of their sub-elements that were optional in the original schema are required. For instance, in the original schema I have the following types (important points indicated by "<-<-"): <xs:simpleType name="RecurrenceIDRangeType"> <xs:restriction base="xs:string"/> <-<- </xs:simpleType> <xs:complexType name="SponsorType"> <xs:sequence> <-<- <xs:element ref="ev:SponsorID" minOccurs="0"/> <xs:element ref="ev:Name" minOccurs="0"/> .... </xs:sequence> </xs:complexType> Which I was able to successfully redefine in XML Spy 2004 like this: <xs:redefine schemaLocation="Events_1.6.xsd"> <xs:simpleType name="RecurrenceIDRangeType"> <xs:restriction base="xs:string"> <-<- <xs:enumeration value="ThisAndFuture"/> <xs:enumeration value="ThisAndPrior"/> </xs:restriction> </xs:simpleType> (RecurrenceIDRangeType even looks like it's correct from this article, but is invalid in XML Spy 2005: http://www.xml.com/pub/a/2000/11/29/schemas/part1.html?page=7) <xs:complexType name="SponsorType"> <xs:complexContent> <xs:restriction base="ev:SponsorType"> <xs:sequence> <xs:choice maxOccurs="2"> (e.g. must have one or the other or both) <-<- <xs:element ref="ev:SponsorID"/> <xs:element ref="ev:Name"/> </xs:choice> ... </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> However, XML Spy 2005 is requiring this: <xs:simpleType name="RecurrenceIDRangeType"> <xs:restriction base="ev:RecurrenceIDRangeType"> <-<- <xs:enumeration value="ThisAndFuture"/> <xs:enumeration value="ThisAndPrior"/> </xs:restriction> </xs:simpleType> This does seem to result in correct instance documents, but I'm not sure what the right way to do this should be. And I can't even figure out how to fix ev:SponsorType there--using the choice seems to render the schema completely invalid. Any ideas? I haven't been able to find many examples of using xs:redefine on restrictions on-line and didn't find much help in this document: http://www.w3.org/TR/xmlschema-1/. My latest efforts to make this work can be found at: http://eberkeley-dev.vcbf.berkeley.edu/UCBCN/UCBEvents.xsd (redefining schema) http://eberkeley-dev.vcbf.berkeley.edu/UCBCN/Events_1.6.xsd (original schema) Thanks very much for any help anyone can give, Allison Bloodworth Principal Administrative Analyst e-Berkeley Program Office University of California, Berkeley (415) 377-8243 abloodworth@b...
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








