You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gregor Karlinger <gr...@iaik.at> on 2000/11/03 11:32:50 UTC
Bug: Twice insertion of a xml:space attribute
Hi all,
Trying to create a DOM document from the example given below with
Xerces 1.2.1, the attribute "xml:space" is inserted twice into the
resulting tree. Once as a AttrImpl node, and once as a AttrNSImpl
node.
Please not, that this behaviour occurs only if the general
feature http://apache.org/xml/features/dom/defer-node-expansion
is set to false.
Namespace processing is switched on by setting the feature
http://xml.org/sax/features/namespaces to true.
---------------------------------------------------------------
<!DOCTYPE doc
[
<!ATTLIST element xml:space (default|preserve) 'preserve'>
]>
<doc>
<element/>
</doc>
---------------------------------------------------------------
Regards, Gregor
---------------------------------------------------------------
Gregor Karlinger
mailto:gregor.karlinger@gmx.net
http://GregorKarlinger.tsx.org
Student of Telematics
Graz, Austria
---------------------------------------------------------------
Re: Bug: Twice insertion of a xml:space attribute
Posted by Elena Litani <hl...@jtcsv.com>.
Hi,
Yes, there is a bug in DOMParser:attlistDecl().
We only use createAttribute() and setNamedItem(). In case of NS we need
to use createAttributeNS() and setNamedItemNS().
The patch is attached. Can somebody commit it?
Thank you!
Gregor Karlinger wrote:
>
> Hi all,
>
> Trying to create a DOM document from the example given below with
> Xerces 1.2.1, the attribute "xml:space" is inserted twice into the
> resulting tree. Once as a AttrImpl node, and once as a AttrNSImpl
> node.
>
> Please not, that this behaviour occurs only if the general
> feature http://apache.org/xml/features/dom/defer-node-expansion
> is set to false.
>
> Namespace processing is switched on by setting the feature
> http://xml.org/sax/features/namespaces to true.
>
> ---------------------------------------------------------------
> <!DOCTYPE doc
> [
> <!ATTLIST element xml:space (default|preserve) 'preserve'>
> ]>
> <doc>
> <element/>
> </doc>
> ---------------------------------------------------------------
>
> Regards, Gregor
> ---------------------------------------------------------------
> Gregor Karlinger
> mailto:gregor.karlinger@gmx.net
> http://GregorKarlinger.tsx.org
> Student of Telematics
> Graz, Austria
> ---------------------------------------------------------------
>