Re: [xslt] Embedded Stylesheets



On Aug 14, 2004, at 2:07 AM, Daniel Veillard wrote:

  You also must ask for entity substitution so that libxml2 generate a
tree compatible with the XPath data model.

Ok.

I can't make sense of that code and the error is there. Why use a
Push parse when you have all data already in memory ?

I copied it from our XML+CSS code, which parses incrementally. I can obviously simplify the XSLT case, since that won't be incremental. I can change that.


Why try to fool
the parser about encoding when libxml2 does implement the encoding
detection specified in appendix F of the XML specification ? Also
xmlCreatePushParserCtxt has encoding detection, you're redoing in
a likely untested way what libxml2 does reliably for ages. By doing
a forced cast to UTF16 you're breaking the encoding detection,
you're breaking performances, and you're likely to also break conformance
of the parser. Do not force a cast to UTF-16, it's really really bad !
Beware too of the decoupling from the HTTP engine and the XML parser,
you must read http://www.w3.org/TR/REC-xml/#sec-guessing and RFC 3023
you will have to pass the encoding as declared in the Content-Type
HTTP header.

I didn't write this particular code, but I believe that it was added to fix a bug where XHTML with a BOM was not rendering correctly. I'll try to get you more details so that we can figure out what's going on.


dave



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