Coder Social home page Coder Social logo

simplexmlextended's Introduction

Naming
Original php name: SimpleXmlElement
Preserving array name: SimpleXmlElementPreserveArrays
Adding CData blocks: SimpleXmlElementCDataAvailable
Two above combined: SimpleXmlElementExtended

TODO: rename and split SimpleXMLExtended.php (it actually does 2 things - cdata and arrays
TODO: add tests for @attributes
TODO: care for @attributes, so the array could have 2 elements, but only one is real
TODO: packaging, exclude test&docs, some ideas silverstripe/silverstripe-framework#4312

Build Status

SimpleXml To Json Force Array / consider SimpleXMLExtended as it wil have another method to handle CDATA

SimpleXMLExtended

Better JSON serializer for php

Returns an array in json_encode result for only one nested element in SimpleXML object

inspired by http://stackoverflow.com/questions/16935560/php-convert-xml-to-json-group-when-there-is-one-child

https://hakre.wordpress.com/2013/07/10/simplexml-and-json-encode-in-php-part-iii-and-end/

also review this topic http://stackoverflow.com/questions/7181269/converting-xml-to-json-using-php-while-preserving-arrays

run code https://eval.in/378064

php can't have object properties with same name, therefore is uses arrays for xml like this item1 item2 ... item9

testing tools: phpunit & phpspec, do we really need phpspec here? maybe add phpspec just for the usage example

--- addition https://eval.in/385372
http://stackoverflow.com/questions/30974496/php-xml-to-json-format-changes-when-number-of-children-is-just-one/30975567?noredirect=1#comment49989691_30975567
add more test cases for heavily used attributes cases

--- notes thsi is how you can exclude docs from the packages, what about tests? composer/composer#1750

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.