W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Re: Using multiple namespaces in an XML instance

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 19 Dec 2001 22:59:40 +0000
Message-ID: <10341461037.20011219225940@jenitennison.com>
To: "Lukas Tan" <lukas.tan@cmis.csiro.au>
CC: xmlschema-dev@w3.org, "Lukas Tan" <lukas.tan@csiro.au>
Hi Lukas,

> While this is not the ideal solution, as I do want to control
> exactly which elements from the other namespaces occur inside the
> "stuff" element (by some means such as using the "ref" attribute of
> the "xsd:element" element), it was the only way I could get the
> validator (Xerces) to accept the schemas. If I try the other (more
> desirable) approach:
> Xerces says it "Cannot resolve the name 'fruit:apple' to a(n) elment
> declaration component." (typo and all).

Strange. I tried using Xerces C++ 1.6.0 and XSV and it worked just
fine. If you can't get it working, post your schema and we can try to
work out what's going wrong.

> As an aside, even when using the "any" wildcard as I currently am,
> if I don't define the types of elements inside the element
> declaration (ie I try to define the element type by saying
> <xsd:element name="blah" type="blah-type">, and then defining "blah
> type" separately), Xerces produces the same error. Do types need to
> be namespace prefixed?

They are interpreted as QNames, so either you need to use a prefix or
you need to make sure that the default namespace declaration is for
the relevant namespace.

> So, is there anything else I'm missing, or is it time for the
> workman to blame his tools and get another validator?

Currently, I think it's always worth testing a schema against multiple

> Just a thought, what's the difference between "xsd" and "xs". The
> initial reccommendation (thanks again)was to use "xs:import", which
> I converted to "xsd:import" because I didn't know the namespace for
> "xs". Is this the cause of all my troubles?

'xs' is the prefix that's used for the XML Schema namespace in the XML
Schema Recommendation, so I tend to use that rather than 'xsd'. Sorry
for the confusion.



Jeni Tennison
Received on Wednesday, 19 December 2001 18:00:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC