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

MSXSL ignoring the mode attribute

Subject: MSXSL ignoring the mode attribute
From: "Michael Leditschke" <mike@xxxxxxxxxxx>
Date: Tue, 2 Jul 2002 16:37:47 +1000
mode attribute in xml
I am running saxon 6.5.2 and MSXSL/MSXML 4.0.

I have the following xml file

<HTMLContents>
  <table>
    <font face="Courier">Some text</font>
  </table>
</HTMLContents>

and the following stylesheet

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="HTMLContents">
    <root>
      <xsl:call-template name="ProcessSection"/>
    </root>
  </xsl:template>
  <xsl:template name="ProcessSection" match="font" mode="Section">
    <xsl:choose>
      <xsl:when test="@face='Courier'">
        <InFont>Section mode</InFont>
      </xsl:when>
      <xsl:otherwise>
         <xsl:apply-templates mode="Section"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <xsl:template match="font">
    <InFont>No mode</InFont>
  </xsl:template>
</xsl:stylesheet>

Saxon (I think correctly) produces

<root>
  <InFont>Section mode</InFont>
</root>

The default template has been recursively applied
in Section mode until the template matching font
in Section mode is reached, and the output produced.

However, MSXSL produces

<root>
  <InFont>No mode</InFont>
</root>

suggesting that the mode has been lost somewhere along
the line.

Is my analysis correct? Is anyone aware of this being a known
bug in MSXML 4.0?



If I change the stylesheet to

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="HTMLContents">
    <root>
      <xsl:apply-templates mode="Section"/>
    </root>
  </xsl:template>
  <xsl:template match="font" mode="Section">
    <InFont>Section mode</InFont>
  </xsl:template>
  <xsl:template match="font">
    <InFont>No mode</InFont>
  </xsl:template>
</xsl:stylesheet>

Both produce

<root>
  <InFont>Section mode</InFont>
</root>

as expected, so it appears to be tied in with the use of call-template.

Regards
Michael



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


Current Thread

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.