[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Matching two consecutive <br><br>

Subject: Matching two consecutive <br><br>
From: "stefan krause" <stefan.krause@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Aug 2004 11:19:35 +0200
fop 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>&#160;</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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.