By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,457 Members | 1,298 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,457 IT Pros & Developers. It's quick & easy.

Why is XMLSchema namespace so different than my custom namespace?

P: n/a
qdm
Below is a snippet that I'm sure is quite familiar to most ...

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

Here, I've given the XMLSchema namespace the prefix 'xsd', and with
that, I can reference datatypes within the XMLSchema namespace ...
i.e., xsd:string.

That's great, but why can't I use that same notation, to reference
dataypes in a homegrown schema ... WITHOUT doing an <import> or
<include>? Is the XMLSchema (and the XMLSchema-instance) sort of
"built-in" to XML tools, such that they don't need to go find the
XMLSchema.xsd at www.w3.org?

Am I correct in assuming I need to <import> or <include> other
(custom) XSD's in order to reference one from another?

Finally, given that the schemaLocation tag is only a "hint", how can I
reliably reference another schema file - to provide data types?

Much Thanks!!!
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


qdm wrote:
Below is a snippet that I'm sure is quite familiar to most ...

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

Here, I've given the XMLSchema namespace the prefix 'xsd', and with
that, I can reference datatypes within the XMLSchema namespace ...
i.e., xsd:string.

That's great, but why can't I use that same notation, to reference
dataypes in a homegrown schema ... WITHOUT doing an <import> or
<include>? Is the XMLSchema (and the XMLSchema-instance) sort of
"built-in" to XML tools, such that they don't need to go find the
XMLSchema.xsd at www.w3.org?
I think so, a validating parser has built-in knowledge of the W3C schema
rules and types, it doesn't load a schema file for that (as that schema
file is not complete anyway I think).
Am I correct in assuming I need to <import> or <include> other
(custom) XSD's in order to reference one from another?
If you want to use elements or types from a different namespace then
yes, you need to import a schema for that namespace.
Finally, given that the schemaLocation tag is only a "hint", how can I
reliably reference another schema file - to provide data types?


That depends on the API of the parser you are using.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.