Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

schema and namespaces

 
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).]
 
    Bookmark Topic Watch Topic
  • New Topic