Created
February 14, 2011 13:08
-
-
Save zubairov/825845 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.talend.test; | |
import java.net.URI; | |
import org.jdom.Document; | |
import org.jdom.input.SAXHandler; | |
import org.jdom.output.Format; | |
import org.jdom.output.XMLOutputter; | |
import org.milyn.SmooksException; | |
import org.milyn.edisax.EDIParser; | |
import org.milyn.edisax.unedifact.UNEdifactInterchangeParser; | |
import org.xml.sax.InputSource; | |
public class Test2 { | |
public static void main(String[] args) throws SmooksException, Exception { | |
String modelURI = "urn:org.milyn.edi.unedifact:d99a-mapping:1.4"; | |
UNEdifactInterchangeParser parser = new UNEdifactInterchangeParser(); | |
parser.addMappingModels(modelURI, new URI("/")); | |
parser.setFeature(EDIParser.FEATURE_IGNORE_NEWLINES, true); | |
SAXHandler handler = new SAXHandler(); | |
parser.setContentHandler(handler); | |
parser.parse(new InputSource(new java.io.FileInputStream( | |
"./99a_cuscar.edi"))); | |
Document doc = handler.getDocument(); | |
// Here you have your document | |
new XMLOutputter(Format.getPrettyFormat()).output(doc, System.out); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment