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

Re: Choosing specific XML node with XSL

Subject: Re: Choosing specific XML node with XSL
From: JBryant@xxxxxxxxx
Date: Wed, 9 Feb 2005 16:27:59 -0600
xml nod
Try this (just tested on Saxon 8):

  <xsl:template match="parent/text()">
    <xsl:value-of select="."/>
  </xsl:template>
 
  <xsl:template match="child1|child2"/>

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




"Hiral Parikh" <hparikh@xxxxxxxxxxxxxxxx> 
02/09/2005 04:21 PM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
<xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
cc

Subject
 Choosing specific XML node with XSL






Hi,
I am dealing with some dynamically generated XML and ran into some XSL
parsing issues.

The XML is something like this:

<parent>this is parent text
                 <child1><child2>this is child text</child2></child1> 
</parent>

I want the text of <parent> only, but
<xsl:value-of select = "//parent/"/>  returns 'this is parent text this is
child text'.

How can I get only the text of <parent> tag and not the <child1><child2>
tag.

Thanks in advance,
Hiral 

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.