[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: inheritance and encapsulation in xslt? / xslt for
> You don't need to add new templates. For example you could define a global > xsl:variable in the importing stylesheet module, that contains the names of > all elements that are to be handled by a template. > > The template itself could match any element, but within its code would > process only elements, whose name is the value of one of the nodes contained > in the global variable. Something like this: > > > <xsl:template match="*"> > <xsl:if test="name() = $vgNames/*"> > <!-- Process this element here --> > </xsl:if> > </xsl:template> In the true spirit of OOP the above code should be in the importing template (the base class does not know how it is going to be extended by the derived class). The code will be something like the following: <xsl:template match="*"> <xsl:if test="name() = $vgNames/*"> <xsl:apply-imports/> </xsl:if> </xsl:template> ===== Cheers, Dimitre Novatchev. http://fxsl.sourceforge.net/ -- the home of FXSL 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
|