Robert Ludewig
Usenet Archive
- Joined
- Jan 29, 2004
- Messages
- 17
- Reaction score
- 0
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"> <xs:element name="Sitemap"> <xs:complexType> <xs:all> <xs:element name="Page"> <xs:complexType> <xs:all> <xs:element minOccurs="1" name="Title" type="xs:normalizedString"/> <xs:element minOccurs="0" name="Description" type="xs:string"/> <xs:element minOccurs="0" name="Linklist"> <xs:complexType> <xs:sequence> <xs:element name="Link" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="ID" type="xs:IDREF" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:all> <xs:attribute name="ID" type="xs:ID" use="required"/> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> </xs:schema>
And when I define a new XML file using this xsd it does not Validate:
<Sitemap xmlns="http://www.htw-dresden.de/SitemapNS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.htw-dresden.de/SitemapNS Sitemap.xsd"> <Page> </Page> </Sitemap>
XMLSpy says: unexpected child element: <Page>
MSXML4 says: the content is not valid, expected: <Page>
WHY does that happen ?? Its a namespace problem right ? What am I doing wrong ?
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.htw-dresden.de/SitemapNS"> <xs:element name="Sitemap"> <xs:complexType> <xs:all> <xs:element name="Page"> <xs:complexType> <xs:all> <xs:element minOccurs="1" name="Title" type="xs:normalizedString"/> <xs:element minOccurs="0" name="Description" type="xs:string"/> <xs:element minOccurs="0" name="Linklist"> <xs:complexType> <xs:sequence> <xs:element name="Link" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="ID" type="xs:IDREF" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:all> <xs:attribute name="ID" type="xs:ID" use="required"/> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> </xs:schema>
And when I define a new XML file using this xsd it does not Validate:
<Sitemap xmlns="http://www.htw-dresden.de/SitemapNS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.htw-dresden.de/SitemapNS Sitemap.xsd"> <Page> </Page> </Sitemap>
XMLSpy says: unexpected child element: <Page>
MSXML4 says: the content is not valid, expected: <Page>
WHY does that happen ?? Its a namespace problem right ? What am I doing wrong ?