xsl-list
[Top] [All Lists]

[xsl] RE : RE: [xsl] Concatenating multiple variables in a XPath statement

2006-06-22 03:40:31
Michael Kay wrote:

  Hi

Thank you Micheal.
There are xpath and element names in the variables. var1 
contains an xpath like /form/body/rows/row[$i] and var2 has 
an element name which is found dynamically in a loop.
I think this is the case that XPath does not support. Am I right?

Correct.

  Mmh, in this special case, it is possible, isn't it?  If I understand
correctly "var2 has an element name which is found dynamically in a
loop" as meaning "var2 is a variable bound in an xsl:for-each, holding
an element name".

    <xsl:variable name="var1" select="..." as="element()*"/>
    <xsl:for-each select="...">
      <xsl:variable name="var2" select="..." as="xs:string"/>
      <xsl:sequence select="var1[local-name() eq var2]"/>
    </xsl:for-each>

  Or something like that, depending on the particularities of the
requirements.

  Did I miss something?

  Mmh, after having wrote that, I'm guessing if "var1 contains an xpath
like /form/body/rows/row[$i]" means "var1 contains a sequence selected
by the XPath expression ..." or "var1 contains a string, the XPath
expression ...".  In the former my example is right, but not in the
later, indeed.

  Regards,

--drkm





























        

        
                
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son 
interface révolutionnaire.
http://fr.mail.yahoo.com

--~------------------------------------------------------------------
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>
--~--