You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jon Evans <jo...@misgl.com> on 2004/04/06 10:46:17 UTC
convert xml in database field to SAX events for pipeline
Hi,
I've got a transformer that does a database lookup (using JDO) and
generates pipeline events with the contents.
e.g. the transformer looks for a <message id="1234"/> tag and replaces
it with:
<message id="1234">
<short>Mail server down</short>
<long>Mail server ms-01 is currently down for maintenance</long>
</message>
It works fine, but I'd like to enhance it. The long description
database field actually contains HTML, so I'd like to generate proper
SAX events from that field rather than just paste it in as CDATA.
Is there a helper class I can use to convert a String of XML into the
right events for a pipeline?
Presumably there are at least two ways of doing it - one for if you are
sure it is valid XML, and another that uses HTMLTidy in case it isn't.
Cheers,
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org