[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[xml] xml schema validation and xmlns attribute
- From: Stefan Kost <kost imn htwk-leipzig de>
- To: xml gnome org
- Subject: [xml] xml schema validation and xmlns attribute
- Date: Wed, 05 Jan 2005 13:30:48 +0100
hi hi,
I've got a very basic problem with schema validation. Below are minial example
files.
Any ideas? And sorry if it is not libxml releated and just my failure in
understanding xml schema.
Stefan
-- case1
> xmllint --noout --schema ./schema1.xsd ./doc1.xml
./doc1.xml validates
-- case2
> xmllint --noout --schema ./schema1.xsd ./doc2.xml
./doc2.xml:2: element buzztard: Schemas validity error : Element buzztard not
declared
./doc2.xml:2: element buzztard: Schemas validity error : Element buzztard not
declared
./doc2.xml fails to validate
-- case3
> xmllint --noout --schema ./schema2.xsd ./doc2.xml
./schema2.xsd:3: element attribute: Schemas parser error : Element 'attribute',
attribute 'name' ['NCName']: The value must not match 'xmlns'.
--- doc1.xml
<?xml version="1.0" encoding="UTF-8"?>
<buzztard/>
--- doc2.xml
<?xml version="1.0" encoding="UTF-8"?>
<buzztard xmlns="http://buzztard.sourceforge.net"/>
-- schema1.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="buzztard" type="xsd:string"/>
</xsd:schema>
-- schema2.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:attribute name="xmlns" type="xsd:string"/>
<xsd:element name="buzztard">
<xsd:complexType>
<xsd:attribute ref="xmlns"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
> xmllint --version
xmllint: using libxml version 20612
compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude
Iconv Unicode Regexps Automata Schemas
Many thanks
Stefan
--
begin:vcard
fn:Stefan Kost
n:Kost;Stefan
org:HTWK Leipzig;FB. IMN
adr:;;Postfach 301166;Leipzig;;04251;Germany
email;internet:kost imn htwk-leipzig de
title:Dipl. Informatiker
tel;work:+49341 30766440
tel;home:+49341 2253538
tel;cell:+49178 3183742
x-mozilla-html:FALSE
url:http://www.imn.htwk-leipzig.de/~kost/about.html
version:2.1
end:vcard
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]