Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

schema and namespaces

 
Manuel Palacio
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns"
xmlns :pcr="http://www.pcr.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/02/22-rdf-syntax-ns channel1.xsd">
<rdf escription>
<pcr :publication>
<pcr:from>2001-12-12</pcr:from>
</pcr :publication>
</rdf escription>
</rdf:RDF>

How can I have 1 single schema that validates this document? I tried:
<?xml version="1.0"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns"
xmlns :pcr="http://www.pcr.com"
elementFormDefault="qualified">
<xsd:element name="RDF" type="channel"/>
<xsd:complexType name="channel">
<xsd:sequence>
<xsd:element name="Description" type="pcr :publication"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="publication">
<xsd:sequence>
<xsd:element name="from" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
using Xerces 1.4 but it did not work. Could someone tell me how to write a schema with multiple namespaces correctly?
Thanks
[This message has been edited by Manuel Palacio (edited July 31, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic