use of org.whole.lang.xml.util.SaxHandlerBuilderOperation in project whole by wholeplatform.
the class PersistenceTest method testSaxHandlerBuilder.
@Test
public void testSaxHandlerBuilder() throws Exception {
Document xmlModel = (Document) XmlSourcePersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/xsd/util/javaee_web_services_client_1_2.xsd"));
ModelBuilderOperation op = new ModelBuilderOperation();
SaxConsumerHandler saxHandler = new SaxConsumerHandler(op, !EntityUtils.isResolver(xmlModel.getProlog().getXmlDecl()));
SaxHandlerBuilderOperation sbop = new SaxHandlerBuilderOperation(saxHandler, saxHandler);
new ModelTemplate(xmlModel).apply(sbop);
assertTrue(Matcher.match(op.wGetResult(), xmlModel));
}
use of org.whole.lang.xml.util.SaxHandlerBuilderOperation in project whole by wholeplatform.
the class HtmlPrettyPrinterVisitor method visit.
public void visit(IEntity entity) {
IEntity xhtmlDocument = BehaviorUtils.apply("whole:org.whole.lang.html:HTML5Semantics#toXHtml", entity);
HtmlSerializer serializer = new HtmlSerializer(out.asWriter());
SaxHandlerBuilderOperation sbop = new SaxHandlerBuilderOperation(serializer, serializer, "http://www.w3.org/1999/xhtml");
if (xhtmlDocument != null)
new ModelTemplate(xhtmlDocument).apply(sbop);
}
Aggregations