|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Versioning dependency among namespaces
Hi, all I have a similar question regarding the thread RE: Valid reference to external namespace? URL: http://lists.xml.org/archives/xml-dev/200412/msg00562.html in the xml-dev mailing list. I am hoping you could help me resolving some confusions. The situation is the following: suppose I have two schemas defined: s1_v1.xsd and s2_v1.xsd, for two different namespace n1 and n2. In n2, there is only one top-level element, say e2. In s1_v1.xsd, I need to refer to e2 in n2. I understand that the normal way to do this is to import the n2 namespace defined by s2_v1.xsd, then create a reference like "n2:e2" in s1_v1.xsd. However, by using the import mechanism, I create a dependency to n2 defined by s2_v1.xsd. When s2 changes to s2_v2.xsd, though the top-level element is still e2, the namespace is changed to n2' effectively. It seems that I need to also update the import statement in s1_v1.xsd in order to reference the right namespace. This is exactly what I try to avoid since nothing else in s1_v1.xsd is changed. (1) One possible approach would be instead of using import and reference, use the any namespace, i.e., define something like: <element name="e2"> <xs:any namespace="##other" processContents="lax" /> </element> then use the code in program to control the versioning issue. (2) Others have proposed that we just use something like <xs:element ref="n2:e2" minOccurs="0" /> in s1_v1.xsd without importing n2 nor defining the prefix "n2" in s1_v1.xsd. My questions are: (a) Is it legal to refer to an element in another namespace without explicitly importing it in XML schema? If not, could you point me to the right section in the XML Schema spec that stipulates that? (b) Would a good XML parser fails the validation of an XML instance based on the other proposal? (c) Is there a better way than (1) to handle the versioning dependency problem above? Your help is much appreciated. --Hong
|
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








