Re: [xsl] create a xsl rule

Subject: Re: [xsl] create a xsl rule
From: Lionel Crine <crine@xxxxxxxxxxxx>
Date: Thu, 20 Mar 2003 15:08:26 +0100
At 14:26 20/03/2003 +0100, you wrote:
Hi Lionel!

First of all, it seems to me, that your xml structure does not meet your needs.
If the graphic section and your (a)'s belong together why is there no tag around the whole block?

That's a good question. The answer is that I didn't create the DTD.



Secondly your para rule is handling all para tag's so none should be displayed.
If the (a)'s get displayed and the (b)'s don't, than there is some code in your xsl directly accessing the (a)'s. That a new para rule won't solve your problem.

Yes there is a rule on etm that accessed directly to para. Here is it :


<xsl:template match="etm[graphic and count(para)='1' and following-sibling::etm[1]/*[not(graphic or figure or table)]]">
<xsl:variable name="gen" select="generate-id()" />
<table border="0" width="100%">
<tr>
<td valign="top">
<span style="float:right">
<xsl:attribute name="width">
<xsl:value-of select="graphic/@width" />
</xsl:attribute>
<xsl:apply-templates select="graphic" />
</span>


<xsl:apply-templates select="following-sibling::etm[not(graphic or figure or table) and not(preceding-sibling::code[1]) and generate-id(preceding-sibling::etm[graphic or table or figure][position()=1])=$gen]/*" mode="mode1" />
</td>
</tr>
</table>
<br />
</xsl:template>


It's a little bit complicated, but that's the way it is...

Keeping your stucture you would need to rewrite the etm's parent rule.
There you can access the etm-siblings withing an for-each loop and process the following para siblings in a second nestled for-each structure using an apply-templates for the para's with a mod-attribute or a with-param tag.
I'd need more details to say what's best.


Robert

So if I understand well, I had to do what I didn't want to do, rewrite the etm's rules.


Lionel


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread