Subject: Re: [xsl] Exclude elements in transformation From: "M. David Peterson" <m.david@xxxxxxxxxx> Date: Thu, 16 Sep 2004 05:21:49 -0700 |
<data rulesStructure="one"> <a>foo</a> <b>foo2</b> <c>better than foo!</c> <d>foo who?</d> <e>i'm an independent</a> </data>
<rules rulesStructure="one"> <a> <b> <c priority="1"/> <d priority="1"/> </b> </a> <e alwaysInclude="true"/> </rules>
Sonke Ruempler <mailto:ruempler@xxxxxxxxxxxxxxx> wrote on Thursday, September 16, 2004 11:58 AM:
Andrew Welch <mailto:ajwelch@xxxxxxxxxxxxxxx> wrote on Thursday, September 16, 2004 11:41 AM:
This will do what you ask:
<xsl:template match="*[preceding-sibling::A]"/>
But I suspect there might be a better solution - I think it's preferable to not select the nodes to process in the first place, rather than select everything and use a no-op template to suppress the things you don't want. You would need to give a little more information for that kind of answer.
Thx for your quick answer.
Check the thread 'XSLT and FO/FOP workarounding' for details of my problem - maybe you know a better solution ;-)
My templates for now are:
[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?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Exclude elements in trans, Sonke Ruempler | Thread | RE: [xsl] Exclude elements in trans, Sönke Ruempler |
RE: [xsl] <xsl:test="">, Phillip Nicolson | Date | [xsl] XSL newbie help needed, Ashley Mort |
Month |