cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Evans <jon.ev...@misgl.com>
Subject convert xml in database field to SAX events for pipeline
Date Tue, 06 Apr 2004 08:46:17 GMT
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


Mime
View raw message