RE: [xsl] msxml

Subject: RE: [xsl] msxml
From: "Stuart Celarier" <stuart@xxxxxxxxxxx>
Date: Thu, 16 May 2002 07:58:08 -0700

The confusion is understandable and widespread, that's why I wrote that
article. Thanks for your questions, I will think about how to
incorporate the answers in the next version of the article.

> Does it mean that every user has to have msxml4.0 installed?

Exactly how you use it within you application will determine your answer
to this question. If you use MSXML version-specific classes (e.g.,
Msxml2.DOMDocument.3.0) in your script or code, the code will fail if
that specific version of MSXML is not installed on the user's computer.
You can safeguard your code using logic similar to the MSXML Sniffer
(link in the article) to determine if a required version of MSXML is
present, if it is not you could display an error message and links for
installing the required component. Or you may have more control over
end-user systems (e.g., in a corporate, enterprise environment) and be
able to guarantee the component is present by other means.

If you use the version-independent classes (e.g., Msxml2.DOMDocument) or
the <?xml-stylesheet?> processing instruction, and you specify the real
XSLT 1.0 namespace (i.e., not WD-xsl), then you really are requiring
MSXML 3.0 and requiring that it be installed in replacement mode. I
think that last condition makes it worthwhile to avoid
version-independent classes and use the version-specific classes

If performance is critical to you, XSLT processing in MSXML 4.0 is
reported to range from 4 to 8 times faster than in MSXML 3.0. You may
find other reasons to select one or another of these versions, such as
bugs fixed (or introduced) and whatnot.

> How can I incorporate msxml4.0 within the xsl file?

You don't. There are three parts that come together in an XSLT
transformation: the XSLT stylesheet document, the XML source document,
and some code or script that invokes the XSLT processor. Recall that the
XSLT 1.0 specification details the XSLT language, but does not specify
how the XSLT processor is loaded and run - that is vendor specific. You
incorporate use of MSXML 3.0 or 4.0 in your code invoking the
transformation, not in your XSLT stylesheet or in your XML source
document. As I mentioned above, your code can be prepared to use either
one depending on which is found on the user's computer, similar to the
logic used in the MSXML Sniffer. Maybe that is what your question is
really trying to get at?

In any case, now you realize why it is (currently) problematic to do
client-side XSLT transformations - who knows how the user's computer is
configured? You either have to take care to test that in your code or
guarantee that the processor you use is present by some other means. Or
perform the transformation on the server side if that is appropriate.


 XSL-List info and archive:

Current Thread
  • [xsl] msxml
    • normbishop1 - Thu, 16 May 2002 01:00:38 -0400
      • Stuart Celarier - Thu, 16 May 2002 07:58:08 -0700 <=