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

Re: Recursive evaluation of elements

Subject: Re: Recursive evaluation of elements
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Sat, 12 Dec 2009 11:58:45 +0000 (GMT)
Re:  Recursive evaluation of elements
Rowan Sylvester-Bradley wrote:

  Hi,

> Item 'c' expands OK, but the value of
the name element in
> item c1 is:
> <name>Item C ({$p1/name}) delivered by
Second Class</name>

> What I need is:
> <name>Item C (A nasty cheap one)
delivered by Second Class</name>

> Can anyone suggest how to do this?

  I
didn't look into the details, but it seems you simply want to
expand
expressions recursively: as long as the result of an
expansion contains curly
braces, it should be expanded itself.
So at first glance, I would adapt the
following:

    <xsl:matching-substring>
       <xsl:value-of select="
saxon:eval(
               saxon:expression(regex-group(1)),
$tablerow,
               $source
             )"/>
</xsl:matching-substring>

into the following (but as I said, I didn't look
into the
details, for instance would you have to adapt params, etc.):
<xsl:matching-substring>
       <xsl:variable name="expanded" as="text()">
<xsl:value-of select="
              saxon:eval(
saxon:expression(regex-group(1)),
                  $tablerow,
$source
                )"/>
       </xsl:variable>
<xsl:apply-templates select="$expanded" mode="#current"/>
</xsl:matching-substring>

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/

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.