Subject: [xsl] FW: Variable changing and/or sequences From: "Kermit Tensmeyer" <klt_7940@xxxxxxxxxxx> Date: Fri, 7 Mar 2008 11:51:29 -0600 |
XSLT v2 Variables in a template can't be updated and so the use of recursion in template calls with params with altered values is the current pattern of choice. If I don't use recursion, is there a way to change a sequence? <variable name="list" select="fn:remove($list, xpath on list[@fp='X']"> ah heck code example <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template select="/"> <xsl:variable name="nodelist" select="//files"/> <processed_set> <xsl:for-each select="/target/refer/set"> <xsl:apply-templates select="."/> <xsl:variable name="tmpMatch" select="@path"/> </xsl:for-each> <the_magic_happens_here> remove each node in nodelist where attribute fp has value $tmpMatch </the_magic_happens_here> <for-each select="$nodelist"><xsl:apply-templates select="."/></for- each> <!-- so this is the set of "files elements" nodes where @fp did not match --> </processed_set> </xsl:template> <template et. al. />* </xsl:stylesheet> I want to process the 2 set of nodes, one at time with for-each. On the first nodelist <for-each select="/target/refer/set">, I apply-template for the current node, and remove any node in the 2 set that would match on criteria [identity, attribute match, what-ever]. When the processing is complete, I want to <for-each> on the nodes that haven't been removed. Other than a pattern of recursion, what methods can I use to remove nodes from a nodelist? == Kermit Tensmeyer
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSL omit part of a text i, David Carlisle | Thread | [xsl] Execute Stylesheet, Sean Tiley |
RE: [xsl] XSL Remove part of a text, Michael Kay | Date | Re: [xsl] XSL Remove part of a text, David Carlisle |
Month |