|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: templates matches ... ?
On Wed, 30 Jan 2002 17:34:06 +0100, you wrote:
>Hello,
>
>I've something like :
>
><xsl:template match="xml.fre.FREKernelKernel.FREGeneralDocument">
> .... a lot of lines in here ....
></xsl:template>
><xsl:template match="xml.fre.FREKernelKernel.FREDocument">
> .... exactly the same as above..... a.lot of lines in here ....
></xsl:template>
>
>I can't imagine that this is the way it should be written ?
If you want the same substitution for two different elements then you
can either write:
<xsl:template match="x | y">
....
</xsl:template>
or, if one version is not quite the same as the other give one
template a name:
<xsl:template match="x" name="common">
<!-- matches x's, and can also be called from another template by
name -->
...
</xsl:template>
<xsl:template match="y">
... this bit only for y's
<xsl:call-template name="common" />
<!-- here its the same as an 'x' -->
... more stuff for just y's
</xsl:template>
Your element names do not look right either. Apart from the fact that
all names beginning with xml (in any mix of case) are reserved, you
need to read about either patterns or namespaces or both - I'm not
sure which.
Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email
Melvaig Software Engineering Limited
voice: +44 (0) 1445 771 271
email: tcn@xxxxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








