0

Is there an equivalent of Microsoft .Net's SQLXML Bulk Load (http://msdn.microsoft.com/en-us/library/ms171878.aspx) for Postgresql/PostGIS that I can run on linux? I have a huge and complicated XML file I'd like to import into PostGIS on a linux server without having to write a ton of code to shred the XML. I already have the XSD for it (this one: http://www.dft.gov.uk/transxchange/schema/schemas.htm) so I was hoping I could just specify the relations in the XSD (eg sql:key-fields="ProductID") and set it going.

If there isn't what's the next best thing to import it if I don't want to have to spend weeks writing code to convert XML into tables?

Patrick64
  • 430
  • 6
  • 12

1 Answers1

1

I am not aware of any utility, but I wonder if this is because, for the most of the open source weakly typed languages have good XML file parsers you could use to just pull it into a giant data structure and process it however you like.

So assuming you don't have files that are are huge, my recommendation would be something like Perl, DBI, and XML::Simple.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
  • Thanks. I tried Pentaho data integration and a few others but I didn't find anything that was quite the same. In the end I coded it by hand in node.js using node-expat to parse the XML and the postgresql COPY command to insert into the database. – Patrick64 Dec 03 '13 at 12:54