xpath question

  • Thread starter Starton X. Mangrove
  • Start date
S

Starton X. Mangrove

In my xml document I have a description element that contains varying xhtml,
along the lines of

<description>this is a test</description>

-or-

<description><b>hello</b><br />this is a test<br /></description>


When trying to select the description element in xpath...
<xsl:copy-of select="description/*"/>

....Im getting uneven results. I would like get everything inside the
description elements, but if I have no markup inside the description
elements nothing is returned. If my description node is:
<description>this is a <b>test</b></description>

then only "test" is returned. What is the correct way to get the varying
stuff inside the description elements?

thanks in advance
 
R

Richard Tobin

Starton X. Mangrove said:
When trying to select the description element in xpath...
<xsl:copy-of select="description/*"/>

That selects the element children of description. If you want
all the children, use description/node().

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top