|All requests||>||Looking for an ONIX feed parser and g...||>||Request new recommendation||>||Featured requests||>||No recommendations|
by Ken Robinson - 8 years ago (2015-02-24)
I am looking for help in parsing and/or generating ONIX feeds.
These are used in the publishing industry.
See this page for more information:
3. by Maik Greubel - 8 years ago (2015-02-26) Reply
Do you have an example feed where someone can test its implementation?
4. by Ken Robinson - 8 years ago (2015-02-26) in reply to comment 3 by Maik Greubel Comment
A test ONIX xml can be found at widgetsontheweb.com/onixtest/testonix.xml (this is where I've been experimenting)
5. by Maik Greubel - 8 years ago (2015-02-26) in reply to comment 4 by Ken Robinson Comment
Do you already checked the packagist.org site? Here I found some package which matches the keyword:
1. by Manuel Lemos - 8 years ago (2015-02-25) Reply
There seems to not exist yet classes to handle the ONIX format.
Anyway this is a XML format, so I guess general purpose XML generator and parser classes would do.
Would you like recommendations for XML parsers or generators?
2. by Ken Robinson - 8 years ago (2015-02-25) in reply to comment 1 by Manuel Lemos Comment
If you have some, I would appreciate it. I know of the ones that come with PHP.
6. by Manuel Lemos - 8 years ago (2015-02-28) in reply to comment 2 by Ken Robinson Comment
OK, my recommendation is what follows below.
For parsing I use this XML parser class that can parse whole document structures into an array that is easy to process.
You just need to pass a parameters array that describes the whole document structure that you can expect, like types of tags, nested sub-tags, tag element values, etc..
The class blog has a tutorial article that explains what to do to process any XML document with a single call. You can try following that tutorial and post a comment if you have any questions.
For generating XML, I use this XML Writer class although nowadays PHP comes with better XML generating features.