cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans ...@domek.be>
Subject Re: Include XML string into the pipline via transformer
Date Tue, 23 Mar 2004 12:43:11 GMT
in transform(Document doc) you can access the document in a DOM like 
fashion ie

Element a = document.createElement("myelement");
Element b = document.createElement("myelementchild");
Element addedParameter = document.createElement("parameter");
addedParameter.setAttribute("name", "output");
Element addedParameterValue = document.createElement("value");
addedParameterValue.appendChild(document.createTextNode("some text here"));
addedParameter.appendChild(addedParameterValue);
b.appendChild(addedParameter);
a.appendChild(reqparams);
document.appendChild(req);

I don't know if there is an "easier" way than this.

HTH
Jorg

Stephan Coboos wrote:

> Hello,
> 
> I need to include xml coming from a database as string into the pipline 
> via my own transformer. (Please do not ask why writing my own 
> transformer. I need it..). I had seen, including xml coming form sources 
> (xml files) is very easy using the SourceUtil. But how can I include xml 
> which exists not as source but as string? Is there already a tool 
> avaiable which makes it easy like the SourceUtil?
> 
> Any examples?
> 
> Thank you very much.
> 
> Regards
> Stephan
> 


Mime
View raw message