Subject: [xsl] Complex Template Match From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 22 Jul 2004 14:11:57 -0700 |
Hello, I have a complicated match... and complicated to explain, but I will try. I pass 2 XML sources to a stylesheet: BROWSER_VARS ENTRY_TEMPLATE ENTRY_TEMPLATE will have 50 nodes that match "ENTRY". BROWSER_VARS will have 1-50 "ELEMENT" entries. I "apply-templates" on $ENTRY_TEMPLATE//Entry/Element. (I could apply-templates on BROWSER_VARS but there is no way to perform a lookup from BROWSER_VARS to ENTRY_TEMPLATE). The lookup "match" I do from and ENTRY element to BROWSER_VARS is a concatenation of the name element of ENTRY and the position() against the BROWSER_VARS/ELEMENT name attribute. It looks like this: === TEMPLATE MATCH SNIPPET === <xsl:template match="Element"> <xsl:variable name="element_name"><xsl:value-of select="concat(@name,'_',$position)"/></xsl:variable> <xsl:value-of select="$BROWSER_VARS//ELEMENT[@name=$element_name]/."/> With all of that said, I'd like to change the following "apply-templates" rule: <xsl:apply-templates select="Element"/> To include only "Element"(s) who have a $BROWSWER_VARS//ELEMENT match. Is this possible? Karl
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Infinite Loop when param , Michael Kay | Thread | RE: [xsl] Complex Template Match, Karl J. Stubsjoen |
Re: [xsl] Infinite Loop when param , Wendell Piez | Date | [xsl] Indent?, Chris Carrier |
Month |