Skip to content

Reading XML with both attributes and fields elements #1

Description

@pwaeckerle

Hi,

I am trying to use xmlconvert function xml_to_df to read an XML file that contains properties in both attributes and XML own elements. A simplified example :

<xml>
  <country id="US" name="United States of America">
    <property name="currency" value="USD"/>
  </country>
</xml>

I manage to recover the properties (id, name) for each country, but not to list in addition currency.

To further complete my example, I also have nested (hierarchical) XML elements which I am not interested to extract (but they seem to interfere with the extraction. Completing my previous example :

<xml>
  <country id="US" name="United States of America">
    <property name="currency" value="USD"/>
    <city id ="NYC" name = "New York">
      <property name="area" value="121260"/>
      <property name="population" value="8175133"/>
    </city>
  </country>
</xml>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions