You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Lenz, Evan" <le...@seattleu.edu> on 2002/11/08 09:37:10 UTC

Serializer for d-o-e?

I understand why Cocoon disables the use of disable-output-escaping in XSLT.
However, in my current project, which involves parsing XML results from
Google containing escaped (and non-well-formed) HTML, I need to find a way
to disable output escaping for certain sections of text, perhaps based on
the presence of a special attribute or PI that I can generate when
necessary. Does Cocoon provide a way of parameterizing an existing
serializer to do this? Has anyone implemented such a serializer? I would
think that such a customization of an existing XML serializer should be
pretty simple, but the Cocoon serialization framework is so abstract that
I'm having trouble finding the right code to extend or modify.

Any related information or help would be appreciated.

Thanks,
Evan

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Serializer for d-o-e?

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
J.Pietschmann wrote:

 > Lenz, Evan wrote:
 >
 >> I understand why Cocoon disables the use of disable-output-escaping
 >> in XSLT.
 >> However, in my current project, which involves parsing XML results from
 >> Google containing escaped (and non-well-formed) HTML, I need to find
 >> a way
 >> to disable output escaping for certain sections of text, perhaps
 >> based on
 >> the presence of a special attribute or PI that I can generate when
 >> necessary. Does Cocoon provide a way of parameterizing an existing
 >> serializer to do this? Has anyone implemented such a serializer? I would
 >> think that such a customization of an existing XML serializer should be
 >> pretty simple, but the Cocoon serialization framework is so abstract
 >> that
 >> I'm having trouble finding the right code to extend or modify.
 >
 >
 > The answer is quite simple: you can't. D-o-e only works if the
 > XSLT processor serializes the result itself, the information
 > which text nodes are supposed to be d-o-e'd on output is not
 > transported through the SAX pipelines Cocoon uses for plumbing
 > it's components.


JAXP provides two special PIs to handle the case when serialization
isn't performed by the XSLT engine :
- <?javax.xml.transform.disable-output-escaping?> to start d-o-e and
- <?javax.xml.transform.enable-output-escaping?> to stop it.

See also
http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-commons/java/external/src/javax/xml/transform/Result.java?rev=1.2

Hope this helps, but use it wisely !

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }





---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Serializer for d-o-e?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Lenz, Evan wrote:
> I understand why Cocoon disables the use of disable-output-escaping in XSLT.
> However, in my current project, which involves parsing XML results from
> Google containing escaped (and non-well-formed) HTML, I need to find a way
> to disable output escaping for certain sections of text, perhaps based on
> the presence of a special attribute or PI that I can generate when
> necessary. Does Cocoon provide a way of parameterizing an existing
> serializer to do this? Has anyone implemented such a serializer? I would
> think that such a customization of an existing XML serializer should be
> pretty simple, but the Cocoon serialization framework is so abstract that
> I'm having trouble finding the right code to extend or modify.

The answer is quite simple: you can't. D-o-e only works if the
XSLT processor serializes the result itself, the information
which text nodes are supposed to be d-o-e'd on output is not
transported through the SAX pipelines Cocoon uses for plumbing
it's components.
One work around would be to do the opposite: emulate serializing
in XSLT and use a text serializer, with some magic so that the
client gets a content-type=text/html.

J.Pietschmann


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>