On Mon, 28 Jul 2014 19:49:59 +0100 Colm O hEigeartaigh <[email protected]> wrote:
> > Question: What does the while loop above exactly do? > > Is that question addressed to me? It reads from the InputStream... > > https://github.com/coheigea/testcases/blob/master/apache/santuario/santuario-xml-encryption/src/test/java/org/apache/coheigea/santuario/xmlencryption/EncryptionUtils.java > > Colm. Sorry, it was primarily addressed to Mujahed, but since it's also wrong in the patch you provided to Mujahed the question may also be something for you:-) Hehe, yup, it reads from the inputStream...and how long? And moreover what is the expected outcome from Document document = StAX2DOM.readDoc( > > > XMLUtils.createDocumentBuilder(false), > > > securityStreamReader); return document; after the loop? Mujahed? Marc > > > On Mon, Jul 28, 2014 at 6:47 PM, Marc Giger <[email protected]> wrote: > > > Hi, > > > > > XMLStreamReader securityStreamReader = > > > inboundXMLSec.processInMessage( > > > xmlStreamReader, null, > > > eventListener); > > > > > > > ... > > > > > while (securityStreamReader.hasNext()) { > > > securityStreamReader.next(); > > > } > > > > > > > Question: What does the while loop above exactly do? > > > > > > > > Document document = StAX2DOM.readDoc( > > > XMLUtils.createDocumentBuilder(false), > > > securityStreamReader); return document; > > > } > > > > > > > ... > > > > > The output is: > > > result: > > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > > > > When you have found the answer you will see that this is the > > expected output from the above code. Also it will be > > very easy for you to change the code so that it works > > as desired/expected. > > > > Please share the solution or come back if my tip didn't help you. > > > > Thanks, > > > > Marc > > > > > > -- > Colm O hEigeartaigh > > Talend Community Coder > http://coders.talend.com
