|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Traversing nodes and storing a matched value
Mat,
You may want to change your calling sequence -- by the time you "parseExclusions" you've already written an "ul". Anyway, to answer your question, XSL is set oriented, so you could something like this to write only those menus containing at least 1 <existes> = siteID: This input: <data> <menu id="1"><existes>01</existes></menu> <menu id="2"><existes>1</existes><existes>2</existes></menu> <menu id="3"><existes>2</existes></menu> </data> Against this XSL: <?xml version="1.0" encoding="iso8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:variable name="siteID" select="2"/> <xsl:template match="node()|@*">
<xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy>
</xsl:template><xsl:template match="menu[not(existes = $siteID)]"/> </xsl:stylesheet> produces: <?xml version="1.0" encoding="UTF-8"?> <data> <menu id="2"> <existes>1</existes> <existes>2</existes> </menu> <menu id="3"> <existes>2</existes> </menu> </data> Thus, when you call write-menu, you may want to pass in only those menus with contain a qualifying existes. --A From: Mat Bergman <matbergman@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Traversing nodes and storing a matched value Date: Tue, 28 Jun 2005 20:52:17 -0700 (PDT) _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfee. Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








