Subject: [xsl] Matching two consecutive <br><br> From: "stefan krause" <stefan.krause@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 23 Aug 2004 11:19:35 +0200 |
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()[1])='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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Howto generate a list xpa, Michael Kay | Thread | Re: [xsl] Matching two consecutive , David Carlisle |
RE: [xsl] Encoding base64 with XSLT, David . Pawson | Date | Re: [xsl] Matching two consecutive , David Carlisle |
Month |