[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Implementing "value-of" on a (DOM) Node

Subject: Re: Implementing "value-of" on a (DOM) Node
From: Gerard Maas <gerard.maas@xxxxxxxxxx>
Date: Tue, 21 Nov 2000 18:57:31 +0100
xpathapi node value
Well, In my hurry I found a way to do it:

    XObject obj = XPathAPI.eval(node,".");
    String result = obj.toString();

If the node is a element node with children, you could even refer to them
using the relative XPath

    XObject obj = XPathAPI.eval(node,"-path goes here-");

I'm very happy it's working!

It is even possible to iterate over a nodeList. That's useful to generate
things like tables or menus.

Thanks anyway!! :-)

Gerard.

Gerard Maas wrote:

> Hi,
>
> I'm currently working in a project involving Cocoon as framework where
> I'm trying to integrate Generic XML data sources into XML templates to
> be "cocoonized": fed into the Cocoon reactor to tranform the resulting
> XML in a compatible form for the target device (VoiceXML, XHtml, WAP...)
>
> While doing this, I've been having difficulties to implement the
> insertion of XML 'pieces' (a piece (for me) is a XPath retrieving only
> one subtree).
> The XPath stuff is alredy working but I'm stuck trying to get the value
> of the node retrived by the call to XPath. I get a org.w3c.dom.Node and
> I'd like to apply a function that would retrieve what xsl:value-of
> select=<this node> would.
> I saw the XSLT processor implementation (XALAN)  but I can't get a grip
> in the code (ElementValueOf).  Is there somewhere a more comprehensive
> way to do that?
>
> ValueOf (org.w3c.dom.Node)  :- String
>
> Thanks in advance,
>
> Gerard.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.