Skip to main content
Solved

Retrieve some values from XML


oliver.morris
Contributor
Forum|alt.badge.img+12

Hi, I am trying to pull some content from XML and making a mess of it.

I use the XMLFragmenter extract from this:

<?xml version="1.0" encoding="UTF-8"?><wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:workspace_wfs="workspace_wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberOfFeatures="5" timeStamp="2019-10-11T13:52:44.446Z" xsi:schemaLocation="http://www.opengis.net/wfs https://geoserver.xxx.com/geoserver-cluster/schemas/wfs/1.1.0/wfs.xsd workspace_wfs https://geoserver.xxx.com/geoserver-cluster/wfs?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typeName=workspace_wfs%3Abasin_models"><gml:featureMembers><workspace_wfs:basin_models gml:id="basin_models.48"><workspace_wfs:changedetect_date>2019-09-11T09:33:46Z</workspace_wfs:changedetect_date><workspace_wfs:changedetect_uuid>46af9f38-5edd-4b33-8f15-6cadafcc5c40</workspace_wfs:changedetect_uuid></workspace_wfs:basin_models><workspace_wfs:basin_models gml:id="basin_models.49"><workspace_wfs:changedetect_date>2019-09-11T09:33:46Z</workspace_wfs:changedetect_date><workspace_wfs:changedetect_uuid>c6fa6e9a-e2a5-4815-8df3-0a05a4e9bbe1</workspace_wfs:changedetect_uuid></workspace_wfs:basin_models></gml:featureMembers></wfs:FeatureCollection>

elements to match:

"workspace_wfs:changedetect_uuid"

This gets me to here:

<?xml version="1.0" encoding="UTF-16"?><workspace_wfs:changedetect_uuid xmlns:workspace_wfs="workspace_wfs">46af9f38-5edd-4b33-8f15-6cadafcc5c40</workspace_wfs:changedetect_uuid>

but what I really just want is the guid in the attribute.

What do I use to extract this?

 

Many Thanks

 

Oliver

Best answer by ebygomm

If you go into in Flatten Options tick Enable Flattening you can get your result from the XMLFragmenter

 

View original
Did this help you find an answer to your question?

6 replies

bruceharold
Contributor
Forum|alt.badge.img+17
  • Contributor
  • October 11, 2019

Hi, you can use the XML reader directly, like the attached.

oliver.xmlxml2none.fmw


oliver.morris
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • October 11, 2019

thanks @bruceharold I am reading this in from an HTTPCaller and so dont have that luxury.

 


oliver.morris
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • October 11, 2019

I managed to do it, I dont quite now how but it populates a field.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • October 11, 2019

If you go into in Flatten Options tick Enable Flattening you can get your result from the XMLFragmenter

 


bruceharold
Contributor
Forum|alt.badge.img+17
  • Contributor
  • October 11, 2019
oliver.morris wrote:

I managed to do it, I dont quite now how but it populates a field.

Yeah by trial and error me too.

xml2none.fmw


oliver.morris
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • October 11, 2019
ebygomm wrote:

If you go into in Flatten Options tick Enable Flattening you can get your result from the XMLFragmenter

 

thank you @egomm that works! have a good weekend.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings