Skip to main content
I am trying to learn how to manipulate xml files with fme. I thought it would help me to set a small project, but I´m already lost. 

 

 

Project outline: Retrieve GetCabilities.xml from a URL. Manipulate the xml file to extract layer names, contact person, Boundingboxes, and KeyWords and write these into a Shapefile.

 

 

I´m basically lost at the first hurdle because I can´t really understand which methods/transformers I should be using. 

 

 

1. Create xml Writer and tell fme to create fme-feature types for Layer, Contact, BBOX,KEyword.

 

 

2. This splits the elements up into 4 fme-feature  types. Next I thought I should somehow extract the coordinates and make a point feature which can be grouped according to layer-name and converted to a polygon. Obviously this is not easy.

 

 

 

Could someone offer me a step for step way to do this? or is it too difficult for a beginner?

 

 

Yours,

 

 

Rob

 

 

 

 

 

 

 

Hi Rob,

 

 

I think it's not so difficult if you divide the workflow into several steps. The main flow would be: 1) Read the XML file. i.e. create features having required attributes  - layer name, contact person, coordinate values of bounding box etc. - from XML elements and / or attributes. 2) Create geometries (bounding boxes) based on attributes holding coordinate values. 3) Merge required attributes to bounding boxes if necessary. 4) Write bounding boxes with attributes into a shape file.  

 

At first, you will have to learn how to read an XML file. There are many related documentations in FMEpedia, I think these are good starting point. XML FAQ: Reading and Writing XML http://fmepedia.safe.com/articles/FAQ/XML-FAQ-Reading-and-Writing-to-the-Extensible-Markup-Language-Format Reading XML - Simple Approach using Feature Paths http://fmepedia.safe.com/articles/How_To/Reading-XML Reading XML/GML http://fmepedia.safe.com/articles/How_To/Reading-XML-GML

 

 

Takashi
Hi,

 

In addition to Takashi's answer for step 2 have a look at the GeometryReplacer, it will convert your XML geometry holding attribute into features .

 

 

Itay

Reply