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

Re: Putting parameter into XPATH expression

Subject: Re: Putting parameter into XPATH expression
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Fri, 22 Jun 2001 16:23:25 -0400
Re:  Putting parameter into XPATH expression
You are making it too hard.  This does what you said you want:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='text'/>

<xsl:template match="/a">
   <xsl:apply-templates select='b/c'/>
</xsl:template>

</xsl:stylesheet>

Let the processor do the work, keep things simple.  This code picks out the
b/c nodes one after another and then the built-in default template outputs
their text content.

(Of course, you could make this into html instead of text if you want.)

Cheers,

Tom P

[MacEwan, James (Information Services)]

> In the code extract below, I always get the result "OneOneOne" instead of
> "OneTwoThree" which I am expecting.
>
> I found a work around (based on my previous experience writing compilers)
> that gets XSL processor to do what I want: "<xsl:value-of
> select="a/b[$Position + 0 ]/c"/>"
>
> Can someone tell me a better (more correct) way to do this?
>
> XML ------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <a>
>   <b> <c>One</c> </b>
>   <b> <c>Two</c> </b>
>   <b> <c>Three</c> </b>
> </a>
>
>



 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.