Skip to main content
Question

Extracting values from XML - a little different from most others

  • April 3, 2019
  • 2 replies
  • 10 views

Yes - another XML question - however - taking the XML below - how do I extract the values just from the 'details_view' - i.e. I want the 'USER' data. I tried the flattening which could work, but I don't know how to differentiate between the two 'views'. 

 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<file>
      <views>
        <view type="summary_view">
          <nodes>
            <node>
              <properties>
                <property type="field_name">DATE_CREATED</property>
                <property type="field_data" year="2019" month="3" day="12" hour="11" minute="21" second="52" millisecond="938" offsetMinutes="0" normalized="True">2019-03-12T11:21:52.938+00:00</property>
              </properties>
            </node>
          </nodes>
        </view>
        <view type="details_view">
          <nodes>
            <node>
              <properties>
                <property type="field_name">USER</property>
                <property type="field_data">myusername</property>
              </properties>
            </node>
          </nodes>
        </view>
      </views>
</file>

 

Any help would be gladly received...

Ramo

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • April 3, 2019

If you use the XML Fragmenter you can return 2 features, one for each view. If you expose view.type you can differentiate between them


takashi
Celebrity
  • April 3, 2019

If you use the XML Fragmenter you can return 2 features, one for each view. If you expose view.type you can differentiate between them

You can also extract just your required XML element with a predicate in the Elements to Match parameter (i.e. XPath).

See here to learn more about XPath syntax: https://www.w3schools.com/xml/xpath_syntax.asp