Re: [xslt] omit-xml-declaration



On Sat, Jun 16, 2001 at 08:29:00AM +1000, Pete Ryland wrote:
> On Fri, Jun 15, 2001 at 05:18:03PM -0400, Daniel Veillard wrote:
> > On Sat, Jun 16, 2001 at 05:18:33AM +1000, Pete Ryland wrote:
> > > Anyway, I'm trying to use the omit-xml-declaration output thingo, and no
> > > matter what I do, it doesn't seem to work.
> > [...]
> > >   ...
> > >   outdoc = xsltApplyStylesheet(xmldb_ss, d, 0);
> > >   ...
> > 
> >   the declaration is added at serialization time. You have to use
> > one of the xsltSaveResultTo...() routines for it to take effect.
> > If you need to reproduce the same in your code look at 
> >   xsltSaveResultTo() near the omitXmlDecl usage.
> 
> Ah, ok.  I've been simply using xmlDocDump...() calls, assuming it knew about
> any processing methods/instructions automatically.  Changing over to
> htmlDocDump...() calls seems to do the trick for my purposes.  Is it ok to use
> these if they provide all I need, or is there good reason to explicitly use an
> xmlOutputBuffer?

  The problem is not to use an xmlOutputBuffer, the problem is related
to the fact that a number of information stored in the stylesheet are needed
to serialize the tree according to informations provided in the stylesheet.
I suggest to use the xsltSaveResultToXXX() families of functions of libxslt
   http://xmlsoft.org/XSLT/html/libxslt-xsltutils.html
   
  Otherwise there is no garantee that the output will be conforming to the
the rules provided by the stylesheet.

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Sep 17-18 2001 Brussels Red Hat TechWorld http://www.redhat-techworld.com




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