Re: Matching two consecutive <br><br>
don't use name() in these kinds of tests: name(following-sibling::node())='br' use following-sibling::node()[self::br] > But this does not work for Xalan 2. looks correct to me, when you say it didn't work, what did it do? error? wrong answer? When you have a template that is simply an xsl:choose it's often simpler to break it into two templates@ <xsl:template match="br">one BR</xsl:template> <xsl:template match="br[following-sibling::node()[self::br]]">two BRs</xsl:template> Note this solution and yours will produce two BRsone BR for <br/><br/> as the second one will match the "one" case so you might want to add <xsl:template match="br[preceding-sibling::node()[self::br]]"></xsl:template> so that subsequent nodes produce no output. Also your subject line says <br><br> if you had that as xml then the second br woul dbe a child of the first so none of these solutions would work, if on the other hand your input is xml then it would work but in that case it probably ought to be xhtml in which case the br ought to be in the XHTML namespaec in which case you would need to declare xmlns:h="http://www.w3.org/1999/xhtml" in your stylesheet and replace every occurrence of br in your stylesheet by h:br. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
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