xsl-list
[Top] [All Lists]

Re: [xsl] Recursive evaluation of elements

2009-12-12 06:59:15
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/




















    


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>