[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: would like to simplify my XSLT
Abel Braaksma wrote:
Here's one solution. I believe it will work on both 1.0 and 2.0, but I tested only 2.0. <xsl:template match="* | text()"> <xsl:apply-templates /> </xsl:template> <xsl:template match=" person[document[ not(@relid = ../../../documents/document/@id)]]"> <person name="{name}" /> </xsl:template> It will output all persons that have at least one not-matching @relid, like this, for your input: <person name="Chris" /> Your own code much resembles the way you may do it in imperative languages like Java, PHP, VB or C. However, using templates, you can let the processor do the math for you and you only have to draw the rules. Cheers, -- Abel Braaksma http://www.nuntia.nl
|
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
|