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 "enzo arlati (JIRA)" <xe...@xml.apache.org> on 2005/07/15 14:44:12 UTC

[jira] Created: (XERCESC-1461) n->getNodeValue() return always null

n->getNodeValue() return always null
------------------------------------

         Key: XERCESC-1461
         URL: http://issues.apache.org/jira/browse/XERCESC-1461
     Project: Xerces-C++
        Type: Bug
  Components: DOM  
    Versions: 2.6.0    
 Environment: gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
    Reporter: enzo arlati


getNodeValue() of a node return always null

I get this error also with the standard sample , DOMCount , included inside the xerces-c package.
I made a little change to the source od DOMCount.cpp as show below:
                char *name = XMLString::transcode(n->getNodeName());
                char *value = XMLString::transcode(n->getNodeValue());
                XERCES_STD_QUALIFIER cout <<"----------------------------------------------------------"<<XERCES_STD_QUALIFIER endl;
                XERCES_STD_QUALIFIER cout <<"Encountered Element : "<< name << " = " << value << XERCES_STD_QUALIFIER endl;

                XMLString::release(&name);
                XMLString::release(&value);

So I should expect to see the value assoicate with a node, instead all I get is something like this:
----------------------------------------------------------
Encountered Element : person = (null)
        Attributes
        ----------
        id=five.worker
----------------------------------------------------------
Encountered Element : name = (null)
----------------------------------------------------------
Encountered Element : family = (null)
----------------------------------------------------------
Encountered Element : given = (null)
----------------------------------------------------------
Encountered Element : email = (null)
----------------------------------------------------------
Encountered Element : link = (null)
        Attributes
        ----------
        manager=Big.Boss


The source is the standard sample file personale.xml

  <person id="five.worker">
    <name><family>Worker</family> <given>Five</given></name>
    <email>five@foo.com</email>
    <link manager="Big.Boss"/>

why I can't get the value Worker for trhe element family ?
I miss something or this is a bug ?


Regards, Enzo 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (XERCESC-1461) n->getNodeValue() return always null

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1461?page=all ]
     
Alberto Massari resolved XERCESC-1461:
--------------------------------------

    Resolution: Invalid

getNodeValue() returns NULL on an element node because the DOM specs say so; if you want to extract all the text fragments that are children of the element you can use getTextContent, otherwise you will have to iterate over its children nodes and display the ones that have a type of TEXT_NODE


> n->getNodeValue() return always null
> ------------------------------------
>
>          Key: XERCESC-1461
>          URL: http://issues.apache.org/jira/browse/XERCESC-1461
>      Project: Xerces-C++
>         Type: Bug
>   Components: DOM
>     Versions: 2.6.0
>  Environment: gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
>     Reporter: enzo arlati

>
> getNodeValue() of a node return always null
> I get this error also with the standard sample , DOMCount , included inside the xerces-c package.
> I made a little change to the source od DOMCount.cpp as show below:
>                 char *name = XMLString::transcode(n->getNodeName());
>                 char *value = XMLString::transcode(n->getNodeValue());
>                 XERCES_STD_QUALIFIER cout <<"----------------------------------------------------------"<<XERCES_STD_QUALIFIER endl;
>                 XERCES_STD_QUALIFIER cout <<"Encountered Element : "<< name << " = " << value << XERCES_STD_QUALIFIER endl;
>                 XMLString::release(&name);
>                 XMLString::release(&value);
> So I should expect to see the value assoicate with a node, instead all I get is something like this:
> ----------------------------------------------------------
> Encountered Element : person = (null)
>         Attributes
>         ----------
>         id=five.worker
> ----------------------------------------------------------
> Encountered Element : name = (null)
> ----------------------------------------------------------
> Encountered Element : family = (null)
> ----------------------------------------------------------
> Encountered Element : given = (null)
> ----------------------------------------------------------
> Encountered Element : email = (null)
> ----------------------------------------------------------
> Encountered Element : link = (null)
>         Attributes
>         ----------
>         manager=Big.Boss
> The source is the standard sample file personale.xml
>   <person id="five.worker">
>     <name><family>Worker</family> <given>Five</given></name>
>     <email>five@foo.com</email>
>     <link manager="Big.Boss"/>
> why I can't get the value Worker for trhe element family ?
> I miss something or this is a bug ?
> Regards, Enzo 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (XERCESC-1461) n->getNodeValue() return always null

Posted by "enzo arlati (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESC-1461?page=comments#action_12315913 ] 

enzo arlati commented on XERCESC-1461:
--------------------------------------

I used getTextContent() instead getNodeValue() and I got the result show belowe.
It seems ok but I'm wondering if this, I mean using getTextContent,  is the right method to get value of an element and also what is it the right use of getNodeValue() and where is right to use it ?



----------------------------------------------------------
Encountered Element : person =
    Worker Five
    five@foo.com


        Attributes
        ----------
        id=five.worker
----------------------------------------------------------
Encountered Element : name = Worker Five
----------------------------------------------------------
Encountered Element : family = Worker
----------------------------------------------------------
Encountered Element : given = Five
----------------------------------------------------------
Encountered Element : email = five@foo.com
----------------------------------------------------------
Encountered Element : link =
        Attributes
        ----------
        manager=Big.Boss


> n->getNodeValue() return always null
> ------------------------------------
>
>          Key: XERCESC-1461
>          URL: http://issues.apache.org/jira/browse/XERCESC-1461
>      Project: Xerces-C++
>         Type: Bug
>   Components: DOM
>     Versions: 2.6.0
>  Environment: gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
>     Reporter: enzo arlati

>
> getNodeValue() of a node return always null
> I get this error also with the standard sample , DOMCount , included inside the xerces-c package.
> I made a little change to the source od DOMCount.cpp as show below:
>                 char *name = XMLString::transcode(n->getNodeName());
>                 char *value = XMLString::transcode(n->getNodeValue());
>                 XERCES_STD_QUALIFIER cout <<"----------------------------------------------------------"<<XERCES_STD_QUALIFIER endl;
>                 XERCES_STD_QUALIFIER cout <<"Encountered Element : "<< name << " = " << value << XERCES_STD_QUALIFIER endl;
>                 XMLString::release(&name);
>                 XMLString::release(&value);
> So I should expect to see the value assoicate with a node, instead all I get is something like this:
> ----------------------------------------------------------
> Encountered Element : person = (null)
>         Attributes
>         ----------
>         id=five.worker
> ----------------------------------------------------------
> Encountered Element : name = (null)
> ----------------------------------------------------------
> Encountered Element : family = (null)
> ----------------------------------------------------------
> Encountered Element : given = (null)
> ----------------------------------------------------------
> Encountered Element : email = (null)
> ----------------------------------------------------------
> Encountered Element : link = (null)
>         Attributes
>         ----------
>         manager=Big.Boss
> The source is the standard sample file personale.xml
>   <person id="five.worker">
>     <name><family>Worker</family> <given>Five</given></name>
>     <email>five@foo.com</email>
>     <link manager="Big.Boss"/>
> why I can't get the value Worker for trhe element family ?
> I miss something or this is a bug ?
> Regards, Enzo 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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