[xml] DTD validation & namespaces

Hello Daniel, hello all,

well, i know that's a long-winded topic, but i hope my actual
question is rather basic.
I've read the 'namespaces' part of the libxml2 online docs
and skimmed through the mailing archives, i'd guess two points
could be put out:

- DTD validation for documents that uses prefixes and
  different namespaces is problematic

- DTD validation for documents with a default namespace,
  declared on the root element should be possible using

I've done my first attempts at walking in that direction
by validating a simple document using xmllint (v2.6.1)
(well, to be honest i've tried it first with my application,
but i've checked it with xmllint):

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [
<foo xmlns="http://foo.acme.com/"; />

Using "--valid", i get an validation error:

~>xmllint --valid --noout foo.xml
foo.xml:5: element foo: validity error : No declaration for
attribute xmlns of element foo
<foo xmlns="http://foo.acme.com/"; />

Using "--postvalid", the document validates.

So, even assumed that there's a misconception in my
test-szenario, shouldn't we expect a consistent behaviour?
Or is it actually necessary to declare "xmlns" as attribute
for the root element?

Thanx & Ciao, Markus

Mit freundlichen Gruessen - Kind regards
Markus Keim

________________________Addressed by:________________________
 ORDAT GmbH & Co. KG  -  Serversystems / eCom 
 Dipl.-Inf. (FH) Markus Keim   Fon: +49 (641) 7941-0
 Rathenaustr. 1                Fax: +49 (641) 7941-132
 35394 Gießen                  mailto:markus_keim ordat com
 See:                          http://www.ordat.com
I love deadlines. I like the whooshing sound they make as
they fly by.  -- Douglas Adams

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]