using in xml namespace defined in schema

D

Dominique

I want to use a namespace in an XML file, that I have created in the
schema for this xml file. do i have to redefine this namespace in the
xml file? or is there a way to re-use the definition from the schema?

here is the example I found on the net, that I am trying to validate,
and it doesn't work...

link:
http://www.laltruiste.com/document.php?compteur=2&rep=4&evolution=8

code example:
http://www.laltruiste.com/coursschema/exemples/xsd_import.zip

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
M

Martin Honnen

Dominique said:
I want to use a namespace in an XML file, that I have created in the
schema for this xml file. do i have to redefine this namespace in the
xml file? or is there a way to re-use the definition from the schema?

If your schema declares that an element has to be in a certain namespace
e.g. if you use
<xs:schema
targetNamespace="http://example.com/2004/07/kibology"
elementFormDefault="qualified"
...>
then of course your instance XML document needs to use that namespace by
declaring a prefix for it e.g.
<ki:root
xmlns:ki="http://example.com/2004/07/kibology">...</ki:root>
or use the namespace as the default namespace e.g.
<root xmlns="http://example.com/2004/07/kibology">...</root>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top