You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bill Parod <bi...@northwestern.edu> on 2004/05/19 20:43:45 UTC
AbstractSAXTransformer sendEvents() not producing events
I'm working on a subclass of AbstractSAXTransformer. It produces XML by
exec of another program. The input stream from the exec(ed) process is
parsed into a DOM and passed to sendEvents() to move down the pipeline.
The DOM creation part of this seems to work - I can transform the
resulting DOM and output its xml to System.out. However when I pass that
DOM's root element to sendEvents(), no events are produced to the
serializer following this transformer. Am I not using sendEvents()
properly? Any tips on using sendEvents()?
We're running cocoon 2.1.4 with j2sdk1.4.1_02 on linux. Below is the main
part of the code:
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(cmd,envp);
InputStream is = p.getInputStream();
DocumentBuilderFactory dFactory =
DocumentBuilderFactory.newInstance();
dFactory.setNamespaceAware(false);
DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
Document doc = dBuilder.parse(is);
Node root = (Node) doc.getDocumentElement();
super.sendEvents( root );
TransformerFactory tFactory =
TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(System.out);
transformer.transform(source, result);
Thanks in advance.
Bill Parod
Architect for Scholarly Technologies, Academic Technologies
1970 Campus Drive, Evanston, IL 60208
bill-parod@northwestern.edu 847-491-5368
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org