Yeah, thats sensible behaviour. a.xsl is a NON ALTERNATE stylesheet, so it 
ALWAYS gets applied. If these stylesheets didn't get applied then imaging an 
XSP page combined with your setup, you'd loose the XSP processing step! 

If you want A or B then they BOTH have to be alternate and you have to choose 
one or the other. 

The same debate arose recently WRT the interaction of default and non default 
stylesheets specified in server config directives too. The upshot of that I 
believe was that basically the same theory applies, if a stylesheet has no 
criteria defining when its invoked, then its ALWAYS invoked.

On Thursday 04 September 2003 09:54 pm, Chris Strom wrote:
> Using Apache::AxKit::StyleChooser::PathInfo, I don't seem to be able to
> apply alternate stylesheets anymore when an alternate="no" exists.
> Consider the following XML doc:
>
> == test.xml
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet href="a.xsl" type="text/xsl"?>
> <?xml-stylesheet href="b.xsl" type="text/xsl" alternate="yes" title="b"?>
> <content/>
> ==
>
> When I access test.xml with no PATHINFO, I get the a.xsl stylesheet
> applied.  But when I access test.xml/b, the content to which the
> stylesheet is being applied is not the text.xml content, it's the result
> of the transformation of text.xml by the a.xsl stylesheet.
>
> I'm running:
>
> Apache/1.3.28 (Unix) AxKit/1.62
> XML::LibXML 1.54
> XML::LibXSLT 1.53
>
>
> Here are the two stylesheets:
>
> == a.xsl
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>
>   <xsl:output method="html" indent="yes" encoding="ISO-8859-1"/>
>
>   <xsl:template match="/">
>     <html>
>       <head>
>         <title>a</title>
>       </head>
>       <body bgcolor="#ffffff">
>         <xsl:apply-templates select="content"/>
>       </body>
>     </html>
>   </xsl:template>
>
>   <xsl:template match="content">
>     <b>a</b>
>   </xsl:template>
> </xsl:stylesheet>
> ==
>
> and
>
> == b.xsl
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>
>   <xsl:output method="html" indent="yes" encoding="ISO-8859-1"/>
>
>   <xsl:template match="/">
>     <html>
>       <head>
>         <title>b</title>
>       </head>
>       <body bgcolor="#ffffff">
>         <xsl:apply-templates select="content"/>
>         <xsl:copy-of select="."/>
>       </body>
>     </html>
>   </xsl:template>
>
>   <xsl:template match="content">
>     <b>b</b>
>   </xsl:template>
> </xsl:stylesheet>
> ==
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Tod Harter
Giant Electronic Brain
http://www.giantelectronicbrain.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to