[jboss-dev-forums] [Design of JBoss Web Services] - Re: Signatures and CRs

alessio.soldano@jboss.com do-not-reply at jboss.com
Mon Feb 25 11:40:36 EST 2008


"richard.opalka at jboss.com" wrote : I'm not 100 % sure but IMHO such enclosed 0xD character won't be converted to new line by the parser.

Try this:

  | public void testParser() throws Exception
  |    {
  |       String s = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Body><a>He\rllo</a></env:Body></env:Envelope>";
  |       Logger.getLogger(this.getClass()).info("before: "+s);
  |       ByteArrayInputStream bis = new ByteArrayInputStream(s.getBytes());
  |       Element el = DOMUtils.parse(bis);
  |       Element body = DOMUtils.getChildElements(el).next();
  |       Element a = DOMUtils.getChildElements(body).next();
  |       Logger.getLogger(this.getClass()).info(a.getTextContent());
  |       Logger.getLogger(this.getClass()).info(a.getChildNodes().item(0));
  |       String res = DOMWriter.printNode(el, false);
  |       Logger.getLogger(this.getClass()).info("after: "+res);
  |       assertEquals(s, res);
  |    }
  | 

The \r is converted into in a new line (and the logs show the text node already contains the new line, thus it's created while parsing).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131934#4131934

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131934



More information about the jboss-dev-forums mailing list