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

serializer and deserializer ? #17

Closed
mirinio opened this issue Jul 29, 2021 · 1 comment
Closed

serializer and deserializer ? #17

mirinio opened this issue Jul 29, 2021 · 1 comment
Labels

Comments

@mirinio
Copy link

mirinio commented Jul 29, 2021

Hi,
Great work.

Is there a way to serialize a given onix file with the parser or do you have any example on how to serialize it?
I was currently using the XmlSerializer with typeof OnixMessage but in most cases the OnixMessage is null and I need to get the list of OnixProducts from the foreach you showed in the readme..

Any suggestions?

@jaerith
Copy link
Owner

jaerith commented Jul 29, 2021

Hi @mirinio,

Thanks for the compliment!

Unfortunately, this project doesn't support serialization at this time. It's especially difficult since the ONIX standard has an absurd cornucopia of options, and the purpose of this repo is to parse and then funnel all those options into an actual standardized form as data structures. In order to go into reverse (i.e., serialization), the project would need to present the user with all supported ONIX options and then write it out correctly. Reference tags vs. short tags, alternate tag options to contain the same values, using ONIX character encodings or standard HTML character encodings...all of these would need to be supported and handled properly for serialization. In fact, there's so much work, I would say that it deserves a whole separate project.

As far as your question involving XmlSerializer, are you using the OnixLegacyParser or the OnixParser? If you use one of those, you don't need to use the XmlSerializer yourself, since that is handled for you.

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

No branches or pull requests

2 participants