Matching two consecutive <br><br>
Dear all, I need to distinguish in a mixed content type whether I need to handle one or two <br> tags (This is used in a FOP transformation to insert either <fo:block/> or <fo:block> </fo:block> - if someone has a better solution for how to distinguish between a TEXT<br>TEXT and TEXT<br><br>TEXT situation for FOP I'd love to hear about that two. The first one should cause a line break only and the second one a line break plus an empty line). Let's assume the following content. <text> Hello XSL-List,<br/><br/> This is a <b>nice</b><br/> Day, but I'm too stupid for this simple xsl task.<br/> <br/> Yours,<br/> Stefan </text> Can somebody tell me how to create a matching for the second consecutive br for Xalan? For MSXML the following did work: <xsl:template match="br"> <xsl:choose> <xsl:when test="name(following-sibling::node())='br'">two BRs</xsl:when> <xsl:otherwise>one BR (or this is the second)</xsl:otherwise> </xsl:choose> </xsl:template> But this does not work for Xalan 2. As a rule for the matching it would be OK to just see if the preceding node it a text node or a node with a different name than "br", but I can't make that work with Xalan. Thanks for any help, Stefan
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