Hi!
Given these files
==> sample.dtd <==
<?xml version="1.0" encoding="ISO-8859-1"?>
<!ELEMENT spam:sample EMPTY>
<!ATTLIST spam:sample
xmlns:spam CDATA #FIXED "http://www.cinetic.de/2000/"
>
==> sample.xml <==
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE spam:sample SYSTEM "sample.dtd">
<spam:sample/>
==> sample2.dtd <==
<?xml version="1.0" encoding="ISO-8859-1"?>
<!ELEMENT spam:sample EMPTY>
<!ATTLIST spam:sample xmlns:spam CDATA #REQUIRED>
==> sample2.xml <==
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE spam:sample SYSTEM "sample2.dtd">
<spam:sample xmlns:spam="http://www.cinetic.de/2000/"/>
I get this behaviour (using plain Xerces 1.4):
--> DOMPrint -v=always sample.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE spam:sample SYSTEM "sample.dtd">
<spam:sample xmlns:spam="http://www.cinetic.de/2000/"/>
--> DOMPrint -v=always -n sample.xml
An error occured during parsing
Message:
[this is a DOMException : 14 (NAMESPACE_ERR)]
--> DOMPrint -v=always sample2.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE spam:sample SYSTEM "sample2.dtd">
<spam:sample xmlns:spam="http://www.cinetic.de/2000/"/>
--> DOMPrint -v=always -n sample2.xml
Error at file "/export/home/jhe/tmp/sample2.xml", line 3, column 56
Message: Required attribute 'xmlns:spam' was not provided
An error occured during parsing
The only way to get this working is to never mention the xmlns:spam
attribute in the DTD and just use it in the root element. Is this
what I should expect? AFAIR, the XHTML specs use #FIXED attributes in
the DTD for the namespace, and that would not work with Xerces.
If it's my fault, then this should go to the FAQ, since the symptom
(DOMException 14) is not helpful in finding the cure.
Ciao, Jürgen
--
Jürgen Hermann, Developer ([EMAIL PROTECTED])
WEB.DE AG, http://webde-ag.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]