Il giorno 01/mag/05, alle 23:06, Aur�lien DEHAY ha scritto:
I'm trying to parse an xml stream from a pipeline result in flowscript. I've got the following code:
var stream = new java.io.ByteArrayOutputStream;
cocoon.processPipelineTo("etape2", {"url": url}, stream );
var document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(stream) ;
2 questions then:
* Why parse(String uri) is taken rather than parse(InputStream
is)?
Because a ByteArrayOutputStream is not an InputStream. Try;
var is = new ByteArrayInputStream(stream.toByteArray()); ....parse(is);
HTH,
Ugo
-- Ugo Cei Tech Blog: http://agylen.com/ Source.zone: http://sourcezone.info/ Wine & Food Blog: http://www.divinocibo.it/
smime.p7s
Description: S/MIME cryptographic signature
