Re: Using multiple namespaces in an XML instance

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:
[snip]
> 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
validators.

> 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.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

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