Re: [xslt] XSLT transformation to Plain Text using Python bindingsrequires using children().serialize()?
- From: Craeg K Strong <cstrong arielpartners com>
- To: xslt gnome org
- Subject: Re: [xslt] XSLT transformation to Plain Text using Python bindingsrequires using children().serialize()?
- Date: Sat, 24 Aug 2002 00:21:15 -0400
Hello:
Thanks for the explanation, it is very helpful.
I rewrote my example as per instructions and it works fine.
However, I still have a question, if you'll indulge me....:-)
Because I am writing a pure service, it would be nice to never
write anything out to disk. Is there a "file-like object" somewhere
that you have written or can recommend for use in lieu of
an actual file?
The contract my server must fulfill is that it must return the
transformed contents as a string. I saveResultToFilename()
only to immediately read it back in. Of course, this is just a
small nit, but it is the reason I went off the rails instead of
following the documentation (which I did read, honest :)
I am willing to bet this is a Frequently Asked Question, so
maybe we can put the answer in the docs for the next guy..?
Regards,
--Craeg
Daniel Veillard wrote:
> On Fri, Aug 23, 2002 at 02:19:08PM -0400, Craeg K Strong wrote:
>
>>Obviously, this code will not compile today, because
>>the only choices are XML and HTML. Am I missing something
>>or is the API missing something?
>
>
> You are missing the fact that the output type is in the stylesheet
> and that you need to process the result document with the stylesheet *again*
> using style.saveResultToxxx to generate the serialized output.
> It is explained in the documentation.
> Again and to be 100% clear you should not use the serialize()
> method to serialize the result of a transformation. And reading
> http://www.w3.org/TR/xslt#output
> may prove interesting to you:
>
> "An XSLT processor may output the result tree as a sequence of bytes,
> although it is not required to be able to do so"
>
> An XSLT processing generate a tree, then this tree may be serialized
> as text, XML, HTML or somthing else.
>
> Daniel
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]