Re: [xslt] expand entities



On Mon, Jun 03, 2002 at 02:41:28PM +0100, Matt Sergeant wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Monday 03 June 2002 11:28 am, Daniel Veillard wrote:
> > > There's a strange interaction between libxslt and libxml2's
> > > expandEntitiesDefaultValue flag. If you do XSLT on a stylesheet DOM that
> > > hasn't had it's entities expanded, then the entity gets completely
> > > dropped.
> ...
> > >
> > > Is this a bug, or do you just always have to have entity expansion turned
> > > on?
> >
> >   the latter, the XPath engine do not deal with entities references in the
> > tree so asking the parser to expand the entities is needed. On the other
> > hand this is doable on a case by case basis without forcing the global
> > setting to always turn expansion on, this requires to use a lower layer
> > in the libxml2 parsing API where the user code has access to the parser
> > context (where the replacement flag can be turned on).
> 
> OK, since when using the perl library I can't be sure what flags someone 
> specified when they built their DOM, is there any way I can go through and 
> expand the entities on a DOM that has been passed to me?

  Hum, I can't remember an API for doing this, I don't think this exists.
This is close to the discussion we had a couple of months ago about 
xmlNodeGetContent() in the case of entities and how to handle the recursion
but I doubt there is code reusable as is, sorry.
  This would also lack the DTD attributes defaulting needed for the XPath
data model.

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]