Re: [xslt] expand entities in xsltParseStylesheetFile?



On Thu, May 23, 2002 at 03:06:42PM +0200, Morus Walter wrote:
> Hi,
> 
> I'm currently having a look a the php libxslt wrapper in the domxml
> module.
> 
> One problem I found, is that entities used in stylesheets are not
> properly expanded.
> The wrapper for creating a stylesheet object from a file simply
> calls xsltParseStylesheetFile(file); without making sure, that
> xmlSubstituteEntitiesDefault(1) is called before.

  Problem is taht xmlSubstituteEntitiesDefault() tweak a global setting,
in general it's not a good idea (fine in xsltproc but not in a generic
framework)

> Now, while this is easy to fix in the wrapper, I would like to ask,
> if this shouldn't be done in xsltParseStylesheetFile itself, since
> either a stylesheet contains no entities (in which case it should
> not make a difference) or they must be substituted anyway, to get 
> correct results. So parsing a stylesheet without this option does
> not make much sense. Or did I miss something?
> 

  Right the best would be to ask the parser(s) launched in
xsltParseStylesheetFile() to operate with entity substitution.

> Second, I wrote a xsltSaveResultToString function which serialises
> a result tree to memory, in order to add a output_string method to
> the stylesheet object, which serialises the result tree according to
> the declarations in the stylesheet (currently the wrapper only allowes
> to serialise to html or xml without taking the stylesheet into account).
> I still have to discuss that with the maintainer of the domxml php module
> (he won't have time for this until june), but I think the 
> xsltSaveResultToString function should go to libxslt. It's not a big deal, 
> but it might be useful elsewhere as well.
> So Daniel, would you accept a patch?

  yes that's fine, try to make it use the same framework as the other
serialization functions in that module for maximum code reuse, thanks !

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/



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