Skip to main content
Hi at all

 

after successufll (tank to Itay and Takashi) managed the spatial conversion of xml to  shape/kml/postgis  I need other suggestions on how manage

 

In essence, I would bring in the db (both ESRI geodatabse or postgis) a large part of the fields in the XML linking to their spatial compontent .

 

How can I manage it in a few steps (I have a thousand of xml with same schema)?

 

 

 

TIA

 

best regards

 

fz
Hi,

 

 

Are you looking for a way to read thousands xml files at one run-time? If so, I think the quickest way is to use wildcard (*) in the source dataset parameter of the XML reader. For example:

 

C:\\data\\*.xml

 

or if the files are saved in some sub-directories:

 

C:\\data\\**\\*.xml

 

 

Takashi
Hi Takashi

 

I actually  badly explained my request:  no problem for read multifiles at prompt (thank). Rather I wish import all the field inside each xml (apart the spatial ones) inside a db (may be MsAccess or postgres/postgis or so on....).

 

At what I need  to pay attention?

 

 

thank

 

fz
Hi fz,

 

 

Assume you are using "Feature Paths" option to read XML.

 

When you specify an XML element to "Elements To Match" parameter of the XML reader, the reader generates a feature type; the feature will contain attributes corresponding to all the XML elements and attributes in the specified element.

 

For the sample XML in your previous post, if you specify "identificationInfo", the feature will have these attributes:

 

MD_DataIdentification.citation.CI_Citation.title.CharacterString = AST_L1A

 

MD_DataIdentification.citation.CI_Citation.date{0}.CI_Date.date.DateTime = 2010-02-01T16:38:12.700Z

 

...

 

etc.   Although these attribute names are very long, there are no differences from attributes of a feature read by other format readers. You can write them into any destination dataset after renaming (and transforming if necessary) appropriately.

 

See also these documentations to learn more how "Feature Paths" works:

 

Reading XML - Simple Approach using Feature Paths http://fmepedia.safe.com/articles/How_To/Reading-XML Reading Complex XML or GML using the XMLFlattener

 

http://fmepedia.safe.com/articles/Samples_and_Demos/Reading-Complex-XML-or-GML-using-the-XMLFlattener

 

 

Additionally, when you specify two or more XML elements to "Elements To Match", the XML reader generates multiple feature types. In such a case, you can merge features from the same xml file using FeatureMerger (specify "fme_basename" or "fme_dataset" as the join attribute). Hope this helps.

 

Takashi
Hi,

 

 

In addition to Takashi's answer there is lots to see about XML in the FME Channel. XML is after all one of Don's favourite formats.

Reply