You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2001/03/29 18:29:48 UTC

[Bug 1150] New - Problems with Namespaces and validating parsing

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1150

*** shadow/1150	Thu Mar 29 08:29:47 2001
--- shadow/1150.tmp.8521	Thu Mar 29 08:29:47 2001
***************
*** 0 ****
--- 1,126 ----
+ +============================================================================+
+ | Problems with Namespaces and validating parsing                            |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1150                        Product: Xerces-C                |
+ |       Status: NEW                         Version: 1.4                     |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Normal                   OS/Version: Linux                   |
+ |     Priority:                           Component: Validating Parser (DTD) |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xerces-c-dev@xml.apache.org                                  |
+ |  Reported By: jh@web.de                                                    |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ [This was already mentioned on xerces-c-dev]
+ 
+ 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.
+ 
+ Xerces 1.3:
+ 
+ jhe@lxdev70:~/tmp > DOMPrint-1.3 -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/"/>
+  
+ jhe@lxdev70:~/tmp > DOMPrint-1.3 -v=always -n sample.xml
+ An error occured during parsing
+    Message:
+ jhe@lxdev70:~/tmp > DOMPrint-1.3 -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/"/>
+  
+ jhe@lxdev70:~/tmp > DOMPrint-1.3 -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
+  
+ Xerces 1.2:
+ 
+ jhe@lxdev70:~/tmp > DOMPrint-1.2 -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/"/>
+  
+ jhe@lxdev70:~/tmp > DOMPrint-1.2 -v=always -n sample.xml
+ Fatal Error at file "/export/home/jhe/tmp/sample.xml", line 3, column 
+ 15
+    Message: The prefix 'spam' has not been mapped to any URI
+ <?xml version="1.0" encoding="ISO-8859-1"?>
+  
+ <!DOCTYPE spam:sample SYSTEM "sample.dtd">
+  
+ jhe@lxdev70:~/tmp > DOMPrint-1.2 -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/"/>
+  
+ jhe@lxdev70:~/tmp > DOMPrint-1.2 -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
+ <?xml version="1.0" encoding="ISO-8859-1"?>
+  
+ <!DOCTYPE spam:sample SYSTEM "sample2.dtd">
+                                                 
+ ----
+ 
+ And even these two errors are not justified, IMHO.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org