Re: [xsl] Templates

Subject: Re: [xsl] Templates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 6 Sep 2007 09:48:04 +0100
Sorry, but you haven't given us any idea what problem you are having.


> I am not sure how to implement, "( (NOTE+, (PARA, NOTE*)?) | (PARA,
> NOTE*))?" out of "(TITLE, WARNING*, CAUTION*, ( (NOTE+, (PARA, NOTE*)?)
> | (PARA, NOTE*))?, SUBPARA1*, REFITEM*)". Give it a try.

the DTD is essentially irrelevant to XSLT. Just define templates for
eacgh of the elements. something like

<xsl:template match="NOTE">
<p>NOTE: <xsl;apply-templates/></p>
</xsl:template>

<xsl:template match="p|SUBPARA1">
<p><xsl;apply-templates/></p>
</xsl:template>


<xsl:template match="CAUTION">
<p>CAUTION: <xsl;apply-templates/></p>
</xsl:template>


etc. The DTD tells us that NOTE and PARA elements may come in certain
orders but that does not affect the trandformation in any way, you just
want to transform each element and output the transform in the same
order as the input.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread