Solved

Retrieve some values from XML

  • 11 October 2019
  • 6 replies
  • 2 views

Badge +10

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

icon

Best answer by ebygomm 11 October 2019, 17:23

View original

6 replies

Badge +16

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

oliver.xmlxml2none.fmw

Badge +10

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

 

Badge +10

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

Userlevel 1
Badge +10

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

 

Badge +16

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

Yeah by trial and error me too.

xml2none.fmw

Badge +10

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.

Reply