Yes, I tried it.
/A/text() returns nothing, because it returns the text node under A which is 
empty.


-----Original Message-----
From: Wyles Eric - ewyles [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 12, 2007 11:59 PM
To: xalan-c-users@xml.apache.org
Subject: RE: Extracting a sub-tree as text using xpath

Have you tried /A/text()?

> -----Original Message-----
> From: Ori Doolman [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 12, 2007 4:54 PM
> To: xalan-c-users@xml.apache.org
> Subject: RE: Extracting a sub-tree as text using xpath
> 
> Someone, please?
> 
> 
> 
> -----הודעה מקורית-----
> מאת: Ori Doolman
> נשלח: ה 08/03/2007 09:43
> אל: xalan-c-users@xml.apache.org
> נושא: Extracting a sub-tree as text using xpath
> 
> Dear friends,
> 
> I'm using Xalan 1.1 for extracting text from my xml using xpath
> expression.
> 
> I would like to know how I can extract a whole sub-tree as text.
> 
> Until now, I had documents that look something like this:
> 
> 
> 
> <A>
> 
>             <B> my_data </B>
> 
> </A>
> 
> 
> 
> And I used the expression "/A/B/text()" in order to extract the text
> "my_data".
> 
> 
> 
> Now, I need to extract several nodes (not text nodes) as text. For
> example:
> 
> 
> 
> <A>
> 
>             <B>
> 
>                         <C> my_data</C>
> 
>                         <D> my_other_data </D>
> 
> </B>
> 
> </A>
> 
> 
> 
> I would like an expression that extracts all the <B> sub-tree as text:
> 
> "<B><C>my_data</C><D> my_other_data </D></B>"
> 
> 
> 
> I think it has something to do with the "string()" function, but I'm not
> sure how to use it.
> 
> 
> 
> 
> 
> Thank you,
> 
> Ori Doolman,
> 
***************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.
****************************************************************************

Reply via email to