jQuery in Action, 3rd edition
The moose likes XML and Related Technologies and the fly likes schema and namespaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "schema and namespaces" Watch "schema and namespaces" New topic

schema and namespaces

Manuel Palacio
Ranch Hand

Joined: Oct 16, 2000
Posts: 45
I am trying to learn how to use XML Schema but I am having trouble with namespaces.
Having one XML doc with 2 namespaces like:
<?xml version="1.0" encoding="UTF-8"?>
xmlns :pcr="http://www.pcr.com"
xsi:schemaLocation="http://www.w3.org/1999/02/22-rdf-syntax-ns channel1.xsd">
<rdf escription>
<pcr :publication>
</pcr :publication>
</rdf escription>

How can I have 1 single schema that validates this document? I tried:
<?xml version="1.0"?>
xmlns :pcr="http://www.pcr.com"
<xsd:element name="RDF" type="channel"/>
<xsd:complexType name="channel">
<xsd:element name="Description" type="pcr :publication"/>
<xsd:complexType name="publication">
<xsd:element name="from" type="xsd:date"/>
using Xerces 1.4 but it did not work. Could someone tell me how to write a schema with multiple namespaces correctly?
[This message has been edited by Manuel Palacio (edited July 31, 2001).]

<a href="http://www.newinstance.net" target="_blank" rel="nofollow">http://www.newinstance.net</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: schema and namespaces
It's not a secret anymore!