Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

XercesParser::parse(Node,Node,int) bugged?

2004-10-14
2013-05-02
  • Stefano Lenzi
    Stefano Lenzi
    2004-10-14

    Hi all,
       I think to have find a bug in XercesParser::parse(Node,Node,int) that is when you faound an xml like that
    <test></test>
    you crate a node with name="test" and value=null that is non correct. It should had name="test" and value="".

    What do you think about that?

    P.S.: I solved the problem in the following way.
            org.w3c.dom.Node child = domNode.getFirstChild();
            if(child==null){
                node.setValue("");
                return node;
            }
            do{
                parse(node, child, rank+1);
                child = child.getNextSibling();           
            }while (child != null);

    instead of the old

            org.w3c.dom.Node child = domNode.getFirstChild();
            while (child != null){
                parse(node, child, rank+1);
                child = child.getNextSibling();           
            }

     
    • Satoshi Konno
      Satoshi Konno
      2005-02-09

      Hi Stefano,

      I added the fix to my latest package now, and it will be release with the next version.

      I am sorry that I fogot your report X-<