2

We have two different XML formats representing logically Geography Markup Language (GML), but they are our proprietary formats. Think of it like two separate groups looked at different formats using GML and each one of them decided to modify them in their own way to build up a new format.

Now we want to be able to merge them to single format which will be identical to one of the two input formats.

  1. Do tools exist for this task like supplying input/output samples and it will prepare the specific conversion?

  2. If no - What are the best practices here? Because the boot-force method is just to build simple C/Java program building custom XML format.

  • 1
    Merging XML documents isn't really a GIS task. You may find more experience with Java XML manipulation over in Stack Overflow proper. They may have the same "One question per Question" policy there, so be sure to check the guidelines. – Vince Dec 24 '16 at 12:49
  • @Vince So basically this is pure SW task and no existing GIS tools exist? Because I thought with the GML popularity it might be common for every supplier to have his own GML like format, and therefore when he recieve some data in other format, he will need a converter tool... – michael Dec 24 '16 at 14:13
  • 3
    So there are many formats based on GML, and GIS software can mostly read these files to extract the geospatial coordinates. That is different from being able to merge or transform the XML to another XML format. GML is generally used as standardized way to exchange data, rather than a data storage format, so perhaps you should look at importing your XML into a spatial database, then exporting in which ever format you need. – nmtoken Dec 24 '16 at 14:47
  • 1
    Are you using gml based schemas or just gml like xml? – Ian Turton Dec 24 '16 at 19:39
  • @iant GML like XML that the problem: Both parties developed their own XML format because the use case is by SW so each one has unique SW algorithm knowing how to read his own XML format. Now I need somehow to be able to merge them. – michael Dec 29 '16 at 14:09
1

The standard method to convert one XML format to another is to use Extensible Stylesheet Language Transformations (XSLT).

If you are looking for solutions for undertaking XSLT processing with Java, take a look at: https://stackoverflow.com/questions/4604497/xslt-processing-with-java.

If you want a standalone tool my recommendation would be the oXygen XML editor

If you want to do use Python then lxml is the way to go

If you want to use GIS tools, then there's FME and GeoKettle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.