cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Dam <d....@hippo.nl>
Subject Re: Access to XML bean elements in flowscript/javaflow
Date Wed, 09 Aug 2006 06:44:42 GMT

> bean.getElementsByTagName("beannumber") returns a DeepNodeList-Object. I get an object
Node() via the method item() of the class DeepNodeListImpl.
>
> var number = bean.getElementsByTagName("beannumber");
> var tmp = number.item(0);
>
> tmp is now an object of type Node(). When I say
>
> tmp.getNodeName() I get "beannumber". (that's correct)
>
> When I say
>
> tmp.getNodeValue I get "null". How can I receive the value of my bean?
>
> Thanks
>
>  Saskia
>   
I think you should fetch the first text() node of tmp .. tmp is the beannumber element.. getNodeValue
is just a generic method of the Node interface .. so a Node can be an attribute, text node,
element, document, etc.. "getNodeValue" does not return a value for all of these subinterfaces
per se. 

I think "tmp.getNodeValue().getFirstChild().getNodeValue()" should give you the correct value.
"getFirstChild()" should return the first text node of the beannumber element, which holds
the actual value.


Dennis




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message