Re: [xslt] CDATA sections, nested entities



Daniel Veillard wrote:
> 
> On Fri, Dec 19, 2003 at 06:36:36PM +0100, Markus Bayerlein wrote:
> > Hi all.
> >
> > I installed libxml2-2.6.3 and libxslt-1.1.1 (Tru64 Unix V5.1) and ran
> > into following problems with xsltproc:
> >
> > xsltproc seems to ignore the "cdata-section-elements" attribute of the
> > <xsl:output> element
> >
> >
> > xsltproc did not proprely dereference nested entities, i.e. specifying
> > <!ENTITY bar "bar">
> > <!ENTITY foo "var foo = &bar;">
> > and dereferencing &foo; resulted in
> >
> > var foo =
> >
> > ("bar" was omitted)
> >
> > Placing the entity reference in between <xsl:text> tags and disabling
> > output escaping like this:
> >
> >   <xsl:text disable-output-escaping="yes">
> >   &foo;</xsl:text>
> >   var foo = <xsl:value-of select="$foo"/>;
> >   var foo2 = text;
> >   </script>
> >
> > even resulted in
> >
> > compilation error: file testcase5.xsl line 27 element text
> > xsltParseTemplateContent: xslt:text content problem
> >
> > With xmllint the nested substitution worked.
> >
> > I did not experience this behavior with libxml-2.4.26 and
> > libxslt-1.0.22, which I had installed before.
> 
>   Sorry, if I don't get a full test case to try to reproduce the
> problem, I won't even look at the issue, because all this is supposed to
> work. Please follow the instructions, http://xmlsoft.org/XSLT/bugs.html
> and provide the xsltproc --version output too.
> 
> Daniel
> 
> --
> Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
> veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
> http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt

Hi.

Sorry for my late response, I was on holiday.

I installed the new versions (libxml2-2.6.4 and libxslt-1.1.2) and the
problems with nested entities I mentioned in my first email did not
occur anymore.
However, xsltproc still ignores the cdata-section-elements attribute:

> xsltproc testcase7.xsl testcase.xml
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<script xmlns="http://www.w3.org/2000/svg"; type="text/ecmascript">
  var foo2 = text;
  </script>


> xsltproc --version
xsltproc was compiled against libxml 20604, libxslt 10102 and libexslt
802
libxslt 10102 was compiled against libxml 20604
libexslt 802 was compiled against libxml 20604

(See attachments testcase7.xsl and testcase.xml)

Regards,

Markus
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>

<!DOCTYPE xsl:stylesheet [

<!ENTITY bar "bar"> 

<!ENTITY foo "var foo = &bar;"> 

<!-- namespace for SVG -->
<!ENTITY svgns "http://www.w3.org/2000/svg";>
<!-- namespace for XSLT -->
<!ENTITY xsltns "http://www.w3.org/1999/XSL/Transform";>

]>

<xsl:stylesheet version="1.0" 
                xmlns="&svgns;" 
                xmlns:xsl="&xsltns;"
                exclude-result-prefixes="xsl">

<xsl:output method="xml" indent="yes" encoding="iso-8859-1" standalone="yes"
            cdata-section-elements="script"/>

<xsl:variable name="foo" select="'bar'"/>

<xsl:template match="/">
  <script type="text/ecmascript">
  var foo2 = text;
  </script>
</xsl:template>            

</xsl:stylesheet>
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<rootelement>
  <childelement/>
  <childelement/>
</rootelement>


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