xsl-list
[Top] [All Lists]

Re: [xsl] anyone know why the default xsl in IE sometimes manages to

2007-11-09 05:39:19
actually looking over the documentation seems sort of messed up, maybe
it is just that the first example, a javascript invocation of the
transformation is marked as being Visual Basic that causes me to doubt
that things are correct, but given those initial codes and the example
stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
   <xsl:output method="html"/>
   <xsl:param name="param1"/>
   <xsl:template match="/">
       Hello
   </xsl:template>
   <xsl:template match="/" mode="edit">
       In Edit Mode
   </xsl:template>
   <xsl:template match="/" mode="view">
       In View Mode
   </xsl:template>
</xsl:stylesheet>

what in the world are those modes there for.

I'm not seeing anything in this

var xslt = new ActiveXObject("Msxml2.XSLTemplate.3.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
var xslProc;
xslDoc.async = false;
xslDoc.load("sample2.xsl");
if (xslDoc.parseError.errorCode != 0) {
   var myErr = xslDoc.parseError;
   WScript.Echo("Stylesheet error: " + myErr.reason);
} else {
   xslt.stylesheet = xslDoc;
   var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
   xmlDoc.async = false;
   xmlDoc.load("books.xml");
   if (xmlDoc.parseError.errorCode != 0) {
      var myErr = xmlDoc.parseError;
      WScript.Echo("Document error: " + myErr.reason);
   } else {
      xslProc = xslt.createProcessor();
      xslProc.input = xmlDoc;
      xslProc.transform();
      WScript.Echo(xslProc.output);
   }
}

that calls either the modes or the sets the global xsl:param. It
doesn't really seem like it would work as an example of the
asynchronous transform, there should be some sort of checking of the
ready_state as just one example.

Cheers,
Bryan Rasmussen



On Nov 9, 2007 1:06 PM, bryan rasmussen 
<rasmussen(_dot_)bryan(_at_)gmail(_dot_)com> wrote:
It's always been this way as far as I can remember. Okay I guess
IXSLProcessor explains the situation.

Cheers,
Bryan Rasmussen




On Nov 9, 2007 11:15 AM, Nick Fitzsimons 
<nick(_at_)nickfitz(_dot_)co(_dot_)uk> wrote:
On 9 Nov 2007, at 09:06, bryan rasmussen wrote:

I was wondering why this is, the only explanation I can see would be
if some sort of streaming like api was being run for the
transformation, because after all part of the transformation gets run.
I was wondering if there was some api in MSXML to do this, perhaps a
hidden one that anyone was familiar with.


MSXML's IXSLProcessor object supports asynchronous transformations:
<http://msdn2.microsoft.com/en-gb/library/ms762799.aspx>
so presumably IE is using a compiled version of the stylesheet and
processing it this way.

I'm not sure which version this was introduced in, but the examples
on that page use MSXML 3. Perhaps somebody with a suitably old and
unpatched version of Windows could determine whether the behaviour
you describe was exhibited by older IE versions using the earlier
versions of MSXML.

Regards,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--