xerces cloneNode issue

[email protected]
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <OF649F3C92.86140451-ON65257A9C.00516969-65257A9C.00519D9D@polarisft.com>

Dear Guys,

We had the below code in place for cloning a node.

        Node outNode = inNode.cloneNode(deep);

And then we found that clone node in xerces may sometimes delete a
attribute so we added below piece code but this is still not working. Can
you please let us know the issue?

"My guess is that xerces has another bug that sometimes value of the
attribute becomes null/blank". Is my understanding correct?


                if ( inNode.getNodeType() == Node.ELEMENT_NODE &&
inNode.hasAttributes() ){

                        NamedNodeMap attrMap = inNode.getAttributes();
                        Attr attr = null;
                        Attr outAttr = null ;

                        Attr debugAttr = null;
                        String debugVal = null;



                        for ( int i=0; i<attrMap.getLength(); i++ ){
                                attr = (Attr)attrMap.item(i);
                                // only append deleted attr.
                                if ((((Element)outNode).getAttributeNode
(attr.getName())) == null ){

                                        Dbg.dbg(Dbg.ERRORS, this, "XERCES
PARSER issue1 for GTAC0493287 reproduced for "+attr.getName());

                                        outAttr = getRenderer
().getOutDocument().createAttribute(attr.getName());
                                        outAttr.setValue( attr.getValue
() );
                                        ((Element)outNode).setAttributeNode
(outAttr);
                                }
                        }
                }


Thanks,
karthik



This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only.  If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polarisFT.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.