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

Subject: [xsl] RE : RE: [xsl] Concatenating multiple variables in a XPath statement
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Thu, 22 Jun 2006 12:40:09 +0200 (CEST)
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 riinvente le mail ! Dicouvrez le nouveau Yahoo! Mail et son interface rivolutionnaire.
http://fr.mail.yahoo.com

Current Thread