592593594595596597598599600601602
try { StAXStreamOutputter xout = new StAXStreamOutputter(Format.getRawFormat()); StringWriter sw = new StringWriter(); XMLStreamWriter xsw = soutfactory.createXMLStreamWriter(sw); xout.output(emt, xsw); xsw.close(); String expect = sw.toString(); StAXStreamBuilder sbuilder = new StAXStreamBuilder();
609610611612613614615616617618619
// convert the input to a SAX Stream sw.getBuffer().setLength(0); xsw = soutfactory.createXMLStreamWriter(sw); xout.output(backagain, xsw); xsw.close(); String actual = sw.toString(); assertEquals(expect, actual); } catch (Exception e) {
626627628629630631632633634635636
try { StAXStreamOutputter xout = new StAXStreamOutputter(Format.getRawFormat()); StringWriter sw = new StringWriter(); XMLStreamWriter xsw = soutfactory.createXMLStreamWriter(sw); xout.output(content, xsw); xsw.close(); String expect = sw.toString(); StAXStreamBuilder sbuilder = new StAXStreamBuilder();
643644645646647648649650651652653
663664665666667668669670671672673
StringWriter sw = new StringWriter(); XMLStreamWriter xsw = soutfactory.createXMLStreamWriter(sw); switch(content.getCType()) { case CDATA : xout.output((CDATA)content, xsw); break; case Text: xout.output((Text)content, xsw); break; case Comment:
666667668669670671672673674675676
switch(content.getCType()) { case CDATA : xout.output((CDATA)content, xsw); break; case Text: xout.output((Text)content, xsw); break; case Comment: xout.output((Comment)content, xsw); break; case DocType:
669670671672673674675676677678679
break; case Text: xout.output((Text)content, xsw); break; case Comment: xout.output((Comment)content, xsw); break; case DocType: xout.output((DocType)content, xsw); break; case Element:
672673674675676677678679680681682
break; case Comment: xout.output((Comment)content, xsw); break; case DocType: xout.output((DocType)content, xsw); break; case Element: xout.output((Element)content, xsw); break; case EntityRef:
675676677678679680681682683684685
break; case DocType: xout.output((DocType)content, xsw); break; case Element: xout.output((Element)content, xsw); break; case EntityRef: xout.output((EntityRef)content, xsw); break; case ProcessingInstruction:
678679680681682683684685686687688
break; case Element: xout.output((Element)content, xsw); break; case EntityRef: xout.output((EntityRef)content, xsw); break; case ProcessingInstruction: xout.output((ProcessingInstruction)content, xsw); break; default: