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

Re: templates matches ... ?

Subject: Re: templates matches ... ?
From: Trevor Nash <tcn@xxxxxxxxxxxxx>
Date: Wed, 30 Jan 2002 10:25:56 +0000
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


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.