Re: something I'd really like in XSLT
> now this is of course not a useful example but we can see how the > first example template matches normal priority operation (but the > running of the template is not affected by the priority rules of the > template, basically the execution of the template is now affected by > the priority of how one matches the same element in the ismatched > mode) with the exception that I can switch execution dependent on if > there is an import that matches. I can of course do this by running > xsl:apply-imports and testing if there is any content of my variable > but it seems somewhat fragile to say the least. I didn't follow all the logic here but it seems to be very complicated, and attempting to duplicate much of the matching semantics within xslt. If the requirement is "if foo.xsl and bar.xsl have templates that match this node do what they specify else do ...) Then you can do that without any explict xsl:if testing, just have a top level stylesheet that says <xsl:import href="default.xsl"/> <xsl:import href="foo.xsl"/> <xsl:import href="bar.xsl"/> where default.xsl has a template that matches the node and does ... it will have lowest import precedence so only be invoked if no other template matches. David
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