Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of elements under a node is not mentioned, which create csv with mis-order entry? #33

Open
urwithajit9 opened this issue Apr 27, 2016 · 3 comments

Comments

@urwithajit9
Copy link

urwithajit9 commented Apr 27, 2016

A XML node will have fix number of elements and they can be in order from one node to another node. If during conversion a fixed order is not used then the output csv will have mis-matched values. if XML don't have XSD then well formed XML can have elements in any order among different node. During conversion, we can control the output order of elements and hence the csv will write values under header fields. for example, below example have same elements but order are different but in a output csv value must match with appropriate header field.



<files>

<file name="com.nineleaf.tp-1.apk" source="original">
     <format>Android Package Archive</format>
     <mtime>1407440118</mtime>
      <size>27723910</size>
      <md5>2221c4f14bd4178380df53428bc83cd6</md5>
    <crc32>7dedaf45</crc32>
     <sha1>cbb5ecbf3477ad0def0264bf294fbf22271ca313</sha1>
</file>

<file name="com.striker.lalosfeliz-6.apk" source="original">
        <mtime>1413362341</mtime>
       <size>2705561</size>
       <md5>53033d768f5fbc8ec2913d42fce7c9e2</md5>
        <crc32>e6f36b15</crc32>
       <sha1>ae9c4bc0730f67cba372f09c03da27fc954fa5e6</sha1>
       <format>Android Package Archive</format>
</file>
</files>
@knadh
Copy link
Owner

knadh commented Apr 27, 2016

Ah yes, this is something that needs fixing.

@Real-Gecko
Copy link

Does xml2csv respect XSD?

@Real-Gecko
Copy link

I have a situation when not only fields can have different order, but also may not present in some records:

  <item>
    <title>Empire Burlesque</title>
    <note>Special Edition</note>
    <quantity>1</quantity>
    <price>10.90</price>
  </item>
  <item>
    <title>Hide your heart</title>
    <quantity>1</quantity>
    <price>9.90</price>
  </item>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants