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

RE: saving nodes for later output

Subject: RE: saving nodes for later output
From: "David Santamauro" <david.santamauro@xxxxxxxx>
Date: Sat, 3 Nov 2001 13:08:36 -0500
xsl apply templates mode tab
Trevor, thank you very much. Your help is much appreciated.

> BTW I think your XML would be better expressed something like this:
> <tab>
>  <row>
>   <cell id="1">Text with a footnote.<footnote
> mark="*">This is the text referred to in cell
> id="1"</footnote></cell>
>   <cell id ="2">More text...</cell>
>  </row>
>  <row><cell id="3">&nbsp;</cell></row>
>  <row><cell id="4">&nbsp;</cell></row>
> </tab>

I agree, but unfortunately I have no control over the XML I am dealing with.

I just tried it and the main idea works. The footnote boby is now outside
the table. There is one problem. When I set up empty templates
mode="footnotes", the footnote body disappears. When I comment those empty
templates out, the text content of the table is repeated.

Here is my incoming XML:

<tab>
<row>
<cel al="l">Clone </cel>
<cel al="c">Rev
	<for fnref="56.1"><sp pos="post">a</sp></for>
</cel>
<cel al="c">Phosphorylation
	<for fnref="56.2"><sp pos="post">b</sp></for>
</cel>
<cel al="c">Sub-cellular
	<for fnref="56.3"><sp pos="post">c</sp></for>
</cel>
</row>
<row>
<cel al="l">?13/14</cel>
<cel al="l">++</cel>
<cel al="l">++</cel>
<cel al="l">N
	<foo fn="56.1"><sp pos="post">a</sp>++, 50-100 % etc...</foo>
	<foo fn="56.2"><sp pos="post">b</sp>++, comparable etc... </foo>
	<foo fn="56.3"><sp pos="post">c</sp>?, not detected etc...</foo>
</cel>
</row>
</tab>

****
and the simple style sheet dealing with tables:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="cel">
		<td class="table-data"><xsl:apply-templates /></td>
	</xsl:template>
	<xsl:template match="row">
		<tr><xsl:apply-templates/></tr>
	</xsl:template>
	<xsl:template match="tch">
		<td class="table-data"><xsl:apply-templates /></td>
	</xsl:template>
	<xsl:template match="tsb">
		<td class="table-data"><xsl:apply-templates /></td>
	</xsl:template>
	<xsl:template match="tsh">
		<td class="table-data"><xsl:apply-templates /></td>
	</xsl:template>
	<xsl:template match="tti">
		<td class="table-data"><xsl:apply-templates /></td>
	</xsl:template>
	<xsl:template match="tab">
		<table border="0" width="90%">
			<caption><xsl:value-of select="@id"/></caption>
			<xsl:apply-templates/>
		</table>
		<xsl:apply-templates mode="table-footnotes"/>
	</xsl:template>

	<xsl:template match="cel" mode="table-footnotes">
		<!-- do nothing -->
	</xsl:template>
	<xsl:template match="row" mode="table-footnotes">
		<!-- do nothing -->
	</xsl:template>
	<xsl:template match="tch" mode="table-footnotes">
		<!-- do nothing -->
	</xsl:template>
	<xsl:template match="tsb" mode="table-footnotes">
		<!-- do nothing -->
	</xsl:template>
	<xsl:template match="tsh" mode="table-footnotes">
		<!-- do nothing -->
	</xsl:template>
	<xsl:template match="tti" mode="table-footnotes">
		<!-- do nothing -->
	</xsl:template>


	<xsl:template match="foo">
		<!-- do nothing -->
	</xsl:template>
	<xsl:template match="foo" mode="table-footnotes">
		<br/><a name="footnote_{@fn}"><xsl:apply-templates/></a>
	</xsl:template>

	<xsl:template match="for">
		<a href="#footnote_{@fnref}">
			<xsl:apply-templates/>
		</a>
	</xsl:template>
</xsl:stylesheet>


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


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.