Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for converting x12 837 and 835 to xml using java using this parser #41

Closed
aws-csap opened this issue Oct 27, 2020 · 4 comments
Closed

Comments

@aws-csap
Copy link

I am looking for examples on how to convert x12 837 and 835 files to xml in java using this parser?

@angelaszek
Copy link
Contributor

Here is an example of reading an ANSI 837 5010 X222 file and printing the results out as xml.

For an 835 file you would just need to change the FileType.ANSI837_5010_X222 to the appropriate type.

URL url = this.getClass().getResource("/837_5010/x12_complex.txt");
        X12Reader reader = new X12Reader(FileType.ANSI837_5010_X222, new File(url.getFile()));
        List<Loop> loops = reader.getLoops();
        
        for (Loop loop : loops)
            System.out.println(loop.toXML());

@nddipiazza
Copy link
Contributor

just an fyi. it will not export to common microsoft x12 schema and we cannot add that either because the dtd/xsd license is not open source.

@nddipiazza
Copy link
Contributor

@BruceEdu can we close this issue?

@nddipiazza
Copy link
Contributor

@angelaszek we should close this issue. we answered his question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants