Lists Home |
Date Index |
- To: email@example.com
- Subject: Versioning dependency among namespaces
- From: Hong Liu <firstname.lastname@example.org>
- Date: Thu, 21 Apr 2005 17:41:16 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=uMIaHSCXF6jg1iqyOnAOrB7s9nRK5QZGaVbndIiVkQSvVT3eACwSsnmbH5D0x88EPmTi2gYyDivaX8n9GnYlgsZ5X4KGwZ8ukwrnoPP4+NXTloZvnnCFakW3VPowmjOSlGI728u5NpRKkIvZE29nY5JYb9LJ7ZK3jDJkQSfUQ3w= ;
I have a similar question regarding the thread
RE: [xml-dev] Valid reference to external namespace?
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:
<xs:any namespace="##other" processContents="lax"
then use the code in program to control the versioning
(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.