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

RE: Exclude elements in transformation

Subject: RE: Exclude elements in transformation
From: Sönke Ruempler <ruempler@xxxxxxxxxxxxxxx>
Date: Fri, 17 Sep 2004 09:08:26 +0200
xslt exclude element
M. David Peterson <mailto:m.david@xxxxxxxxxx> wrote on Thursday, September
16, 2004 2:22 PM:

> Im not sure if I completely understand what you are trying to
> do.  Ive checked
> your mentioned thread it seems that you are really trying to
> use template
> matching rules to group/ungroup, include/exclude data
> elements which is going to
> be better served by grouping the data together in the correct
> layout/format first and then apply-templates to the resulting
> temporary 
> tree.  Let me know if
> the following concept is what you are ultimately attempting
> to accomplish...

Thx for your answer. I am really no XML/XSLT geek. I just try to get my
template work :)

I'll try to write the whole story again:

I have a working XSLT Stylesheet for transforming a html-like syntax into
XSL-FO.

The output PDF should have the feature that a Heading never breaks with the
next elements into 2 pages.

XSL-FO has the the property "keep-with-next" for this issue, but I use FOP
as FO-processor and that only supports it within 2 table rows. So i needed a
template, that converts the <hX> tag and the following tag into a <fo:table>
with 2 rows. And the second template, that tells XSLT not to process the
elements preceeded by a <hX> tag twice. And i wrote you my stylesheets, but
the dont work:


>> [XSLT]
>> <xsl:template match="h1|h2|h3|h4|h5">
>> 	<fo:table table-layout="fixed" width="100%">
>> 		<fo:table-column
>> column-width="proportional-column-width(1)"/>
>> 		<fo:table-body>
>> 			<fo:table-row keep-with-next="always">
>> 				<fo:table-cell>
>> 					<fo:block
>> xsl:use-attribute-sets="name()">
>> 						<xsl:apply-templates/>
>> 					</fo:block>
>> 				</fo:table-cell>
>> 			</fo:table-row>
>> 			<fo:table-row>
>> 				<fo:table-cell>
>> 					<fo:block>
>> 						<xsl:apply-templates
>> select="following-sibling::*"/>
>> 					</fo:block>
>> 				</fo:table-cell>
>> 			</fo:table-row>
>> 		</fo:table-body>
>> 	</fo:table>
>> </xsl:template>
>> 
>> <xsl:template match="*[preceding-sibling::(h1|h2|h3|h4|h5)]"/>
>> [/XSLT] 
>> 
>> But that does not work
>> 
>> 1. The second element is there twice.
>> 2. The xsl:use-attribute-sets="name()" does not work here.
>> 
>> Any idea?

So it's just a workaround and would not be possible if FOP supported the
"keep" for all elements as the standard says. I am happy with my 'dirty'
solution, because if FOP will support it the future, the workaround gets
kicked.

I would be really happy if you told me how to get this work!!

Thx, soenke.

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.