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 Dhirendra Pal Singh <dp...@gmail.com> on 2005/08/12 05:34:34 UTC
Help needed in getting the value of a node
Hi All,
I have the following xml...
<my-values name "value 1">
<value>http://127.0.0.1:9955</value>
</my-values>
Now I can read all the attributes of my-values using getAttributes().
Then I can get a DOMElement to value too. But I am unable to get the
value of value which should be "http://127.0.0.1:9955" I have trying
to do it for last 4 hrs, and is unable to do it. Anyhelp would be
greately appreiciated.
I also tryied the following..=20
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* elm1 =3D (element pointing to va=
lue)
XERCES_CPP_NAMESPACE_QUALIFIER DOMAttr *valueAttr =3D
elm1->getAttributeNode(XERCES_CPP_NAMESPACE_QUALIFIER
XMLString::transcode("value"));
But valueAttr is always null... Any reason why?
Thanks a ton in advance...
--
Thanks
/dev/dp
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: Help needed in getting the value of a node
Posted by Dhirendra Pal Singh <dp...@gmail.com>.
Thanks.
Dp
Gareth Reakes wrote:
> Hi,
>
> On 12 Aug 2005, at 4:34, Dhirendra Pal Singh wrote:
>
>> Hi All,
>>
>> I have the following xml...
>>
>> <my-values name "value 1">
>> <value>http://127.0.0.1:9955</value>
>> </my-values>
>>
>
> You XML is not legal. Attributes have the form attr="value". Note the =
>
>
>
>> Now I can read all the attributes of my-values using getAttributes().
>> Then I can get a DOMElement to value too. But I am unable to get the
>> value of value which should be "http://127.0.0.1:9955" I have trying
>> to do it for last 4 hrs, and is unable to do it. Anyhelp would be
>> greately appreiciated.
>
>
>
> Get the child of the element "value". The contents is not its value,
> its a text node. You can also call getTextContent on the element.
>
> Cheers,
>
> Gareth
>
>
> --
> Gareth Reakes, Managing Director Parthenon Computing
> +44-1865-811184 http://www.parthcomp.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: Help needed in getting the value of a node
Posted by Gareth Reakes <ga...@parthenoncomputing.com>.
Hi,
On 12 Aug 2005, at 4:34, Dhirendra Pal Singh wrote:
> Hi All,
>
> I have the following xml...
>
> <my-values name "value 1">
> <value>http://127.0.0.1:9955</value>
> </my-values>
>
You XML is not legal. Attributes have the form attr="value". Note the =
> Now I can read all the attributes of my-values using getAttributes().
> Then I can get a DOMElement to value too. But I am unable to get the
> value of value which should be "http://127.0.0.1:9955" I have trying
> to do it for last 4 hrs, and is unable to do it. Anyhelp would be
> greately appreiciated.
Get the child of the element "value". The contents is not its value,
its a text node. You can also call getTextContent on the element.
Cheers,
Gareth
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org