© 2013 All rights reserved.
0

Acquisition Category structure of the XML feed

How a simple get a structure of menu from eshop from shop’s XML for feed aggregators?

XML feed does not contain category itself, but contains nested items in categories. The categories separate any separator.

We will assume that we have all the categories stored in an array of values (XML load will not solve), The array includes all categories, separated by any separator. We know the separator.

Solution in PHP

Input data:

Data processing

Extract the structure – only for demonstration

Sample output:


array

Solution in Ruby

Input data:

Data processing

Extract the structure – only for demonstration

Sample output:

Comments are closed for this page

About
Hi, i am programmer from the Czech Republic. I love web development (Ruby, Ruby on Rails, PHP, Nette) and iOS development (Objective-C, Cocoa).
To cooperate, here is my phone:
+420 608 836