954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Pulling the outer text from an element when using XSLT

Suppose you have an xml file that has a portion that looks like:

The cat is in the house
The horse is also in the house



Another pigeon?



Since the top div here is buried somewhere within the file, I am trying to isolate it with

...

but I want the only thing to get transferred to the output file to be "The cat is in the house" I realize that in the node tree that forms the input, this is the text child of the

achava
Light Poster
27 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

It's the first text() node so :

<xsl:value-of select="text()[1]">
Erwan Amoureux
Newbie Poster
10 posts since Apr 2010
Reputation Points: 10
Solved Threads: 3
 

It is indeed the first text node, so cool, now you know why I am a newbie. I wll try this momentarily.

achava
Light Poster
27 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You