Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - XSL Template Question >Thread Next - Re: XSL Template Question Re: XSL Template QuestionTo: NULL Date: 7/12/2006 1:02:00 AM
Hi,
Those are named templates that do nothing when you call them.
They can be overwritten in a stylesheet that imports that stylesheet.
For instance if you have
a.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template name="a">in a</xsl:template>
</xsl:stylesheet>
and test.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="a.xsl"/>
<xsl:template match="/">
<xsl:call-template name="a"/>
</xsl:template>
</xsl:stylesheet>
you will get "in a" as output.
But if you add an a template in test.xsl
<xsl:template name="a">a in test.xsl</xsl:template>
then you will get as output "a in test.xsl".
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com
Brill2 wrote:
> Dear Guru's, please forgive the newbie question but I have a problem I
> can't seem to figure out. I am supporting some old XSLT code and I see
> the following code everywhere :
>
> <xsl:template name="left"/>
> <xsl:template name="middle">
> <xsl:call-template name="lixwelcom"/>
> <xsl:call-template name="lixlatnws"/>
> <xsl:call-template name="lislstreq"/>
> <xsl:if test="not($sec:group[@loc:id = 'LIBRARYSTAFF'])">
> <xsl:call-template name="lislstsub"/>
> </xsl:if>
> </xsl:template>
> <xsl:template name="right"/>
> <xsl:include href="../core/lixwelcom.xsl"/>
> <xsl:include href="../nws/lixlatnws.xsl"/>
> <xsl:include href="../req/lislstreq.xsl"/>
> <xsl:include href="../sub/lislstsub.xsl"/>
> <xsl:include href="../default.xsl"/>
>
> My problem is with the tags named :
> <xsl:template name="left"/>
> <xsl:template name="right"/>
>
> I understand what the tag <xsl:template name="middle"> is doing because
> it is defined, however the tags left and right are confusing the heck
> outta me. I don't understand, if a template is undefined like that is
> it legal? Or am I reading the syntax wrong and are these tags actually
> calling a template somewhere named left and right?
>
> Are they just placeholders?
>
> I really cant get my brain around this one. Any help would be
> appreciated and maybe an explanation as to why someone would use xslt
> in this way.
>
> Again thank you for your help
> Regards
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
