RE: Importing stylesheets Precedence Info

Subject: RE: Importing stylesheets Precedence Info
From: "Steven Livingstone" <s.livingstone@xxxxxxxxxxxxxx>
Date: Fri, 28 Jul 2000 00:07:25 +0100
Thanks Mike - eventually got it working.

Basically, because each template could be standalone and so had a "/" match,
when used individually it was fine.
When these were imported into parent stylesheet, then the root match in htat
stylesheet would override he others and so they wouldn't match.

However a certain book pointed me in the direction of modes and so i just
call something like

<xsl:template match="/">
	<xsl:apply-templates select="/" mode="ImportedTemplate1"/>
	<xsl:apply-templates select="/" mode="ImportedTemplate2"/>
</xsl:template>

and so all the templates are executed as I want.

Thanks anyway and I hope that makes sense :-) Took me a while to figure out.
Onto msxml:script now ...

Cheers,
Steven


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Kay Michael
Sent: 27 July 2000 23:37
To: 'xsl-list@xxxxxxxxxxxxxxxx'
Subject: RE: Importing stylesheets Precedence Info


Steven, I think it would be clearer if you told us what you were trying to
achieve. All you are saying is that the processor does what the spec says it
should and this isn't what you want...

Mike Kay

> -----Original Message-----
> From:	Steven Livingstone [SMTP:s.livingstone@xxxxxxxxxxxxxx]
> Sent:	Thursday, July 27, 2000 3:00 AM
> To:	xsl-list@xxxxxxxxxxxxxxxx
> Subject:	Importing stylesheets Precedence Info
>
> It's 3am here, so this may be a simpler question that I think - tired.
> Using
> MSXML3.
>
> Anyway - I have two templates.
> Template A imports template B. Both templates can stand alone, and so both
> have a match for the root.
> Template A overrides B, but I still want B to be executed, but as it
> starts
> at the root, it never is and only the matching template originally in A is
> executed, overriding B. I only want to import B and not actually explicity
> call any templates - it should just encounter matches (and does) as it
> progresses the tree.
>
> So what I did, was in B, matched exactly the element name I am looking for
> (no match on the root) and it seems to work fine.
> This brings in another problem with possible side-effects - this is the
> part
> I am also interested in.
>
> It writes out all the text, as it uses one of the built in templates and
> so
> i get the text which i don't want.
> Therefore, I put the line
>
> <xsl:template match="text()|@*"/>
>
> which basically outputs nothing (or at least no text).
> Are there side effects to this?? It is output to HTML just now, but also
> XML
> will be an output also and I'm not sure if this method will cause me any
> problems.
>
> Any help is much appreciated.
>
> Steven
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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