Re: [xslt] parser

Kris Vloeberghs wrote:

> I recently made an XSLT stylesheet to parse a certain collection of XML
> files, producing a collection of HTML docs.  It all worked on MSXML and with
> Xalan.  I tested both parser for the simple reasons that MSXML runs in IE
> which is widely used, and because Xalan seems to be a parser following the
> upcoming standards quite good.

Could you provide an example?

One of the problems I encountered while moving from MSXML to libxslt
was that for HTML output, MSXML would handle the stylesheet as an HTML
document rather than an XML document.

For instance, to embed javascript you could simply write

  <script language="javascript">
    function foo() { bar = "42"; }

in your stylesheet because MSXML recognizes the script tag and preserves
special characters (like the quote sign).

Libxslt, on the other hand, will handle the above example as XML, and
thus the quotes will become &quot;. To make this work with libxslt I
had to use CDATA sections

  <script language="javascript"><![CDATA[
    function foo() { bar = "42"; }

According to the XSLT specification libxslt is acting correctly here,
because the stylesheet must be XML conformant.

Maybe you are experiencing similar problems.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]