SAXSerializer extends org.sirix.service.AbstractSerializer<XmlNodeReadOnlyTrx, XmlNodeTrx> implements XMLReader { public SAXSerializer(final XmlResourceManager resMgr, final ContentHandler handler, final @Nonnegative int revision, final int... revisions) { super(resMgr, null, revision, revisions); mContHandler = handler; } SAXSerializer(final XmlResourceManager resMgr, final ContentHandler handler, final @Nonnegative int revision,
      final int... revisions); static void main(final String... args); @Override ContentHandler getContentHandler(); @Override DTDHandler getDTDHandler(); @Override EntityResolver getEntityResolver(); @Override ErrorHandler getErrorHandler(); @Override boolean getFeature(String name); @Override Object getProperty(String name); @Override void parse(InputSource input); @Override void parse(String systemID); @Override void setContentHandler(final ContentHandler contentHandler); @Override void setDTDHandler(DTDHandler handler); @Override void setEntityResolver(EntityResolver resolver); @Override void setErrorHandler(ErrorHandler handler); @Override void setFeature(String name, boolean value); @Override void setProperty(String name, final Object value);  }
@Test public void testSAXSerializer() throws SirixException, SAXException, IOException { final StringBuilder sbuf = new StringBuilder(); final ContentHandler contHandler = new XMLFilterImpl() { @Override public void startDocument() { sbuf.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"); } @Override public void startElement(final String uri, final String localName, final String qName, final Attributes atts) throws SAXException { sbuf.append("<" + qName); for (int i = 0; i < atts.getLength(); i++) { sbuf.append(" " + atts.getQName(i)); sbuf.append("=\"" + atts.getValue(i) + "\""); } sbuf.append(">"); } @Override public void endElement(final String uri, final String localName, final String qName) throws SAXException { sbuf.append("</" + qName + ">"); } @Override public void characters(final char[] ch, final int start, final int length) throws SAXException { for (int i = start; i < start + length; i++) { sbuf.append(ch[i]); } } }; final SAXSerializer serializer = new SAXSerializer(holder.getResourceManager(), contHandler, holder.getResourceManager().getMostRecentRevisionNumber()); serializer.call(); assertXMLEqual(XmlDocumentCreator.XML, sbuf.toString()); }