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

Re: Converting XHTML to FO using XHTML2FO.xsl

Subject: Re: Converting XHTML to FO using XHTML2FO.xsl
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 19 Oct 2006 20:44:23 +0100
Re:  Converting XHTML to FO using XHTML2FO.xsl
>   match="br[ancestor::p or ancestor::li][position()=last()]"

That would match a br under a p or li that's the last br of its parent
(not the last br in the p or li). I think the OP wanted

*[self::p or self::li]/decendant::br[last()]

that would select the right elements but isn't a legal pattern, using //
instead of descendant:: would be a pattern but suffer from the same
problem as the quoted expression, 

one way to do this as a pattern would be



match="key('b',generate-id(ancestor::*[self::p or
self::li][1]))[last()])"
<xsl:key name="b" match="br[ancestor::p or ancestor::li]"
use="generate-id(ancestor::*[self::p or self::li][1])"/>

<xsl:template
match="br[generate-id()=generate-id(key('b',generate-id(ancestor::*[self::p
or self::li][1]))[last()])]">


David

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.