Re: [xslt] xsltRunStylesheet() with IOBuf



> On Thu, Feb 27, 2003 at 12:02:59PM -0500, Gennady Feldman wrote:
> > I was browsing the api and 1.0.26 source code (esp. xsltproc part) when
> > I noticed that I could generate the output without needing to save a
> > pointer to the results and doing the transformation call. I could use
> > xsltRunStylesheet() API call. (Simpler version of xsltRunStylesheetUser)
> > I basically managed to get it working with my apache modules by going
> > back to the output buffer callback api. 
> > 
> > A couple of things:
> > - Sometimes it does generate bad HTML code, and I know that this might
> > be a known issue. Is somebody working on this, or should I keep away
> > from using it? I might take a look at this, but i am afraid that it just
> > might get too messy for me to figure it out.
> 
>   I don't see why this would gemerate a different result than xsltproc
> for example. 
> 
Actually there are warnings in the documentation about being careful
using IOBuf interface. And it does seem like the output is a bit
corrupted every so often. I still need to check and see if it's
consistent or not.

http://xmlsoft.org/XSLT/html/libxslt-transform.html#XSLTRUNSTYLESHEET

Apply the stylesheet to the document and generate the output according
to output SAX and IObuf. It's an error to specify both SAX and IObuf.

NOTE: This may lead to a non-wellformed output XML wise ! NOTE: This may
also result in multiple files being generated NOTE: using IObuf, the
result encoding used will be the one used for creating the output
buffer, use the following macro to read it from the stylesheet
XSLT_GET_IMPORT_PTR(encoding, style, encoding) NOTE: using SAX, any
encoding specified in the stylesheet will be lost since the interface
uses only UTF8


> > - Is this method more efficient than the one I was using before? (doing
> > applystylesheet and saving the result using xsltSaveResultTo..) 
> 
>   No, this is the same, xsltRunStylesheetUser() calls
> xsltApplyStylesheetInternal() and xsltSaveResultTo(), you should
> not expect any gain.
> 
I see, because I thought that we could win by not building the result
tree, but somehow optimizing it for output and then just outputting the
result using the callback interfaces or writing it out to a file.

G.F. aka Gena01
http://www.gena01.com



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