GithubHelp home page GithubHelp logo

gbarnett374 / xmlfeedparser Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 340 KB

PHP CLI Program. Takes an XML file and parses it into separate XML & jSON files based on a specified filter.

PHP 100.00%

xmlfeedparser's Introduction

xmlfeedparser

Tested using PHP 5.5.29

PHP CLI Program. Takes an XML file and parses it into separate XML & jSON files based on a specified filter.

The default filter is the 2nd item in the catagory tag which is separated by a > delimiter. Please note the program uses 0 based indexes, which means Food Cupboard will have an index of 1. Example from products.xml: Groceries > Food Cupboard > Tinned & Packet Goods > Fruit & Desserts > Tinned Fruit

All the XML product nodes with a category that contains Food Cupboard will be writen to a foodcupboard.json & a foodcupboard.xml

The program allows you to set the filter, index, and delimiter parameters.

If the tag that you are filtering by contains more then one item separated by a delimiter, then specifiy the delimiter, and the position of the item you want to filter by using a 0 based index.

Otherwise you can leave the default delimiter and set the index to 0 to take the first item in the tag.

To run program: php feedParser_controller.php

Program will create a a feed folder inside /tmp which will contain the xml & jSON files.

xmlfeedparser's People

Contributors

gbarnett374 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.