Code Monkey home page Code Monkey logo

xml-to-array's People

Contributors

arthurperton avatar mtownsend5512 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xml-to-array's Issues

Getting Null when multidimensional xml variables are present

[https://sendeyo.com/en/5bf52e9c87]

Please look at this file and when I do this I got null array in return

 $user = $xml->parse([
    	'nmaprun' => ['uses' => 'nmaprun::scanner'],
    	'element' => ['uses' => 'extraports.state'],
    	// 'followers' => ['uses' => 'user::followers'],
]);

Illegal string offset 'b'

I've got this error, when value in XML is HTML is not encoded or wrapped into CDATA (info).

Example:

<content>This is <b>bold</b></content>

Is there option how to handle this error and continue parsing XML?

Two child nodes with same name

When using parseXml( ); and the XML file has for example two node child's with similar names one of them gets replaced instead of getting grouped together

<?xml version="1.0" encoding="UTF-8"?>
<cbc:ID>1616</cbc:ID>
<OrderResponse>
	<cac:OrderLine>
		<cac:LineItem>
			<cbc:ID>1</cbc:ID>
		</cac:LineItem>
		<cac:OrderLineReference>
			<cbc:LineID>1.00</cbc:LineID>
		</cac:OrderLineReference>
	</cac:OrderLine>
	<cac:OrderLine>
		<cac:LineItem>
			<cbc:ID>2</cbc:ID>
		</cac:LineItem>
		<cac:OrderLineReference>
			<cbc:LineID>2.00</cbc:LineID>
		</cac:OrderLineReference>
	</cac:OrderLine>
</OrderResponse>

Issue when there is only one object instead of a collection of items

If we try to parse this

<?xml version="1.0" encoding="utf-8"?>
<CumulativeOperatingHoursMessages >
    <Links>
        <rel>self</rel>
    </Links>
    <CumulativeOperatingHours datetime="2019-09-12T05:55:15Z">
        <Hour>634.24</Hour>
    </CumulativeOperatingHours>
    <CumulativeOperatingHours datetime="2019-09-12T05:55:15Z">
        <Hour>634.24</Hour>
    </CumulativeOperatingHours>
</CumulativeOperatingHoursMessages>

Its parsed like an array of items -> OK

But if we parse this

<?xml version="1.0" encoding="utf-8"?>
<CumulativeOperatingHoursMessages >
    <Links>
        <rel>self</rel>
    </Links>
    <CumulativeOperatingHours datetime="2019-09-12T05:55:15Z">
        <Hour>634.24</Hour>
    </CumulativeOperatingHours>
</CumulativeOperatingHoursMessages>

It's not parsed as an array and also the keys / indexes are duplicated..... -> Issue

T

for files more than 100mb?

Hello, thank you for making this.
Can i use this for large dataset? my xml files are from 100mb to 500mbs. does it work perfectly with that? thanks alot

option to remove namespace from xml

could be an idea to maybe haven an option to strip namespaces?

I had to process some really old xml files that contained namespaces that made no sense at all.

So I have just replaced tagName with localName in your code, but there might be an better way to do it I guess.

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.