473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why is XMLSchema namespace so different than my custom namespace?

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
1 1372


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Robert Ludewig | last post by:
This is my XML Schema (Sitemap.xsd) : <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.htw-dresden.de/SitemapNS">...
2
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any...
5
by: Alexander Gnauck | last post by:
Hello, i have problems with the Namespaces and the .Net XML Parser My XML looks like this: <query xmlns="jabber:iq:roster"> <item jid="srlee@localhost" name="srlee"...
3
by: Nathan Wallace | last post by:
Hello, I have 2 schema, for argument sake let's call them child.xsd and parent.xsd. I define all my types in parent.xsd and the child.xsd include the parent.xsd using the following tag: ...
0
by: John | last post by:
Hi, I'm creating a component to generate a schema file much like VS generates for DataSets. I'm using XmlSchema to do the job and I also am using a XmlNamespaceManager to manage namespaces. ...
1
by: Rumen Traykov via .NET 247 | last post by:
Have somebody had already the problem of having to write more than one XmlSchema, where some of these schemas have imports to others and respectively derived types? The imports cannot be resolved...
9
by: Fuzzyman | last post by:
Hello, I'm trying to redirect standard out in a single namespace. I can replace sys.stdout with a custom object - but that affects all namespaces. There will be code running simultaneously...
10
by: cykill | last post by:
Hi. I'm new to asp.net and I've been searching on the net and in book on how to use custom namespace. I've created my own custom namespace and I just need a straight answer on where to put the...
1
by: Ryan | last post by:
Hello Xml Gurus, I'm trying to build an XML schema in memory using the System.Xml.XmlSchema namespace objects, validate it, and then write it to a file. The problem I'm facing is that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.