Duplicate "xmlns" attributes appear in the DOM.
-----------------------------------------------
Key: XERCESJ-1371
URL: https://issues.apache.org/jira/browse/XERCESJ-1371
Project: Xerces2-J
Issue Type: Bug
Components: DOM (Level 3 Core), JAXP (javax.xml.parsers)
Affects Versions: 2.9.1
Reporter: Michael Glavassevich
Bug report from Masanori Hayashi (from [email protected] on 04/20/2009):
> Hello,
>
> I encountered a suspicious phenomenon of Xerces-J 2.9.1.
> When I parsed the XML below with Xerces-J 2.9.1, using getAttributesmethod of
> Node A, I got 2 "xmlns" attributes in the result.
> There should be only 1 "xmlns" attribute in the result, I suppose.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE A [
> <!ATTLIST A xmlns CDATA #FIXED 'http://test.xmlns.com/test#'>
> ]>
> <A>
> <A1>test</A1>
> </A>
>
> For example, if I build and run the attached program (Test.java), I get the
> result below. (2 xmlns attributes)
>
> Attr 0:
> NodeName = xmlns
> NodeValue = http://test.xmlns.com/test#
> NameSpace = http://www.w3.org/2000/xmlns/
> Attr 1:
> NodeName = xmlns
> NodeValue = http://test.xmlns.com/test#
> NameSpace = null
>
> But expected result is:
>
> Attr 0:
> NodeName = xmlns
> NodeValue = http://test.xmlns.com/test#
> NameSpace = http://www.w3.org/2000/xmlns/
>
> Is there anyone who knows about this problem?
> Is there any workaround?
>
> I have attached the sample program and the XML file.
> (Please add the path of xercesImpl.jar(2.9.1) and xml-apis.jar(2.9.
> 1) to CLASSPATH.)
>
> My test environment is below:
> Java : jdk1.6.0 update 12
> Xerces: Xerces-J 2.9.1
> OS : Windows XP
>
> I had tested this problem with older versions of Xerces, too.
> And, I got following results:
>
> Xerces 2.9.1 --> problem occurred
> Xerces 2.9.0 --> problem occurred
> Xerces 2.8.1 --> problem occurred
> Xerces 2.8.0 --> problem not occurred
> Xerces 2.7.1 --> problem not occurred
>
> Thanks,
> Masanori Hayashi
See the mailing list archives for more information and test case:
http://markmail.org/thread/5s7udjuufh5naf24
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]