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

Json output #49

Closed
ghost opened this issue Aug 13, 2014 · 3 comments
Closed

Json output #49

ghost opened this issue Aug 13, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 13, 2014

Hey,

For the sake of argument is there a way in which I can get json output of the transformed document.

@irobayna
Copy link
Collaborator

@rajeshyogeshwar not out of the box as far as I know. This could be an interesting feature

@kputnam
Copy link
Owner

kputnam commented Aug 14, 2014

Yes, you can absolutely implement this, but it's intentionally not included with the library. Have a look at the two files in lib/stupidedi/writer for examples of converting an arbitrary X12 syntax tree to another format (either HTML or serialized X12, both of these are just fancy Strings in the end).

Those two writers traverse any X12 document and format them in a generic way (it works for any grammar, for any edition of X12, etc). Alternatively, if you're targeting a specific X12 grammar you can use the Navigation API to explicitly select the parts of the syntax tree you're interested in for that given grammar. Feel free to file issues if you get stuck somewhere.

I'm hesitant about encouraging you to submit a pull request to add this feature to the library because it will be difficult to solve the problem in general -- there is no standard JSON representation for X12 documents, so your patch might solve your use case but not another person's. However, it would be a good demo for other users to see how to use the library, so I'd happily place it in the notes directory if you want to share it.

@kputnam kputnam closed this as completed Aug 14, 2014
@ghost
Copy link
Author

ghost commented Aug 14, 2014

Sure, I will start work on it and if I reach my goal will share it with you. Thanks for responses.

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

2 participants