@@ -0,0 +1,2963 @@
+package de;%0A%0Aimport com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl;%0Aimport de.tblsoft.solr.MyContentHandler;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport org.xml.sax.ContentHandler;%0Aimport org.xml.sax.XMLReader;%0Aimport org.xml.sax.helpers.XMLReaderFactory;%0A%0Aimport javax.xml.transform.TransformerConfigurationException;%0Aimport javax.xml.transform.TransformerFactory;%0Aimport javax.xml.transform.sax.SAXResult;%0Aimport javax.xml.transform.sax.SAXTransformerFactory;%0Aimport javax.xml.transform.sax.TransformerHandler;%0Aimport javax.xml.transform.stream.StreamSource;%0A%0A/**%0A * Created by oelbaer on 11.05.16.%0A */%0Apublic class JaxbTest %7B%0A%0A    @Test%0A    public void testXSL() throws Exception %7B%0A        XMLReader myReader = XMLReaderFactory.createXMLReader();%0A        ContentHandler mySerializer = new MyContentHandler();%0A        String%5B%5D transformationFiles = %7B%22test.stx%22, %22test.xsl%22%7D;%0A        boolean firstFile = true;%0A        TransformerHandler lastHandler = null;%0A        for(String file: transformationFiles) %7B%0A            TransformerHandler currentHandler = getTransformerHandler(file);%0A            if(firstFile) %7B%0A                firstFile = false;%0A                myReader.setContentHandler(currentHandler);%0A                lastHandler = currentHandler;%0A                continue;%0A            %7D%0A            lastHandler.setResult(new SAXResult(currentHandler));%0A            lastHandler = currentHandler;%0A%0A        %7D%0A        if(lastHandler == null) %7B%0A            myReader.setContentHandler(mySerializer);%0A        %7D else %7B%0A            lastHandler.setResult(new SAXResult(mySerializer));%0A        %7D%0A%0A        myReader.parse(%22test.xml%22);%0A%0A    %7D%0A%0A    TransformerHandler getTransformerHandler(String fileName) throws TransformerConfigurationException %7B%0A        if(fileName.endsWith(%22.stx%22)) %7B%0A            SAXTransformerFactory stxFactory = new net.sf.joost.trax.TransformerFactoryImpl();%0A            return stxFactory.newTransformerHandler(new StreamSource(%22test.stx%22));%0A%0A        %7D%0A        if(fileName.endsWith(%22.xsl%22)) %7B%0A            SAXTransformerFactory xslFactory = (SAXTransformerFactory) TransformerFactory.newInstance();;%0A            return xslFactory.newTransformerHandler(new StreamSource(%22test.xsl%22));%0A        %7D%0A        throw new IllegalArgumentException(%22Only the filetypes xsl and stx are supported.%22);%0A    %7D%0A%0A    @Test%0A    @Ignore%0A    public void testStx() throws Exception%7B%0A        TransformerFactory tFactory = new TransformerFactoryImpl();%0A        SAXTransformerFactory saxTFactory = (SAXTransformerFactory) tFactory;%0A%0A        // of course the transformation source must be different%0A        TransformerHandler tHandler1 =%0A                saxTFactory.newTransformerHandler(new StreamSource(%22trans.stx%22));%0A        XMLReader myReader = XMLReaderFactory.createXMLReader();%0A        myReader.setContentHandler(tHandler1);%0A%0A%0A        ContentHandler mySerializer = null;%0A        tHandler1.setResult(new SAXResult(mySerializer));%0A    %7D%0A%7D%0A

add jaxb unit test