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

Re: inheritance

Subject: Re: inheritance
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 11 Apr 2003 22:06:48 +0200
template and inheritance
For a different implementation of inheritance and polymorphism (yes, an
analogue to virtual functions) do have a look at FXSL and this link:

http://fxsl.sourceforge.net/articles/PartialApps/Partial%20Applications.html
#5._Creating_a_new_function_dynamically_-_the_calculator_store_problem.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL



"Jeni Tennison" <jeni@xxxxxxxxxxxxxxxx> wrote in message
news:45177780895.20030411102225@xxxxxxxxxxxxxxxxxxx
> Hi Florian,
>
> > im wondering if its possible to do some kind of inheritance with
> > xslt.
>
> I think that the easiest way to achieve the kind of thing that you're
> after is to have common templates for the common elements, such as:
>
> <xsl:template match="property[@name = 'name']">
>   ...
> </xsl:template>
>
> <xsl:template match="property[@name = 'color']">
>   ...
> </xsl:template>
>
> And then in the templates for <vehicle> and <car> elements just apply
> templates to the children:
>
> <xsl:template match="vehicle | car">
>   <xsl:apply-templates />
> </xsl:template>
>
> The common templates for the name and color properties will be picked
> up for both vehicles and cars. To get the box around the <details>,
> you can use a template that matches the <details> element:
>
> <xsl:template match="details">
>   <div class="box">
>     <xsl:apply-templates />
>   </div>
> </xsl:template>
>
> This way, you get inheritance from the fact that the same properties
> in each are handled by the same templates.
>
> Cheers,
>
> Jeni
>
> ---
> Jeni Tennison
> http://www.jenitennison.com/
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>




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


Current Thread
  • inheritance
    • florian - Fri, 11 Apr 2003 04:54:33 -0400 (EDT)
      • Jeni Tennison - Fri, 11 Apr 2003 05:18:18 -0400 (EDT)
        • Dimitre Novatchev - Fri, 11 Apr 2003 15:49:20 -0400 (EDT) <=

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.