Re: [xslt] Problems with embedded stylesheets, in particular with namespaces



On 09/08/2008, Martin (gzlist) <gzlist googlemail com> wrote:
> Documents with embedded stylesheets may fail to transform with libxslt
>  when they reference namespaces from their surrounding scope...

Daniel or William, can one of you spare some time to look at this
issue? It makes single-file XSLT testcases that work in Internet
Explorer, Mozilla based browsers, and Opera, useless for WebKit
derived programs, due to their reliance on libxslt.

I had a chance to look at the code more today, and decided the idea I
had shortly after the original post, of copying the sub-tree then
walking up the parents and adding missing namespaces, would work. The
method is simple but not efficient (xmlNewNs speculatively allocates
before doing the check to see if the prefix already exists, for
instance) however this is deeply unlikely to be on any performance
critical path. Included with these changes (attached,
embedded_transform.patch) is the addition of setting the base URI of
the stylesheet, required for expressions containing relative links to
external resources.

Also have ten or so stylesheet documents that I'll work into the test
suite if this patch is deemed the right option.

In the process of writing this, I found and fixed (attached,
qname_issues.patch) a couple of analogous issues to the QName problems
in libxml2 that I came across recently.

Martin

Attachment: embedded_transform.patch
Description: Binary data

Attachment: qname_issues.patch
Description: Binary data



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