Re: [xml] Why does XML::LibXSLT (= the Perl 5 / CPAN wrappers for libxslt) Fails a Basic Test on some BSD and other systems?

Nick Wellnhofer <[email protected]> Mon, 17 Feb 2014 13:24:01 +0100
Newsgroups gmane.comp.lang.perl.xml,gmane.comp.gnome.lib.xml.general
Message-ID <[email protected]>
On Feb 17, 2014, at 09:11 , Shlomi Fish <[email protected]> wrote:

> OK, but I don't understand whether I have done something wrong in my XSLT
> stylesheet or alternatively whether it is a bug or an impedance-mismatch
> between libxml2 and libxslt. I'll try running the offending code in Perl =
with
> the latest git versions of libxml2 and libxslt, but I'd like to be sure. =
One of
> my problems is that I didn't quite understand the technical details and
> explanation that were discussed here (as I read the Zvon XSLT tutorial in=
 the
> past, but have not read a more comprehensive book or a SPEC, and furtherm=
ore,
> have forgotten a lot of details).
> =

> Can you enlighten me, please?

It=92s a problem with you stylesheet. XSLT like this is wrong:

    <elem xml:space=3D=93preserve">
        <xsl:attribute name=3D=93attr=94>value</xsl:attribute>
    </elem>

The problem is that there is a text node containing whitespace before the x=
sl:attribute. Text nodes and element nodes are not allowed before xsl:attri=
bute. Normally, these whitespace nodes will be stripped. But since there=92=
s a parent element with xml:space=3D=93preserve=94, the whitespace will be =
kept in this case. I just checked with Saxon and it also reports an error.

Nick

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs