Yes this is almost what I am looking for, 80% there....... you appear to be copying and pasting the whole xml, as opposed to reading a file directly to postgres, which is what I need. What I relay need to do is create a batch file for windows, which I can drop into the folder with the xml's and batch insert. Unfortunately, my knowledge of batching is not as good as I would like. The other option, even more daunting, is to utilise Python to do the batching. Thanks anyway for your help, its a better start, than the rest of the web was offering!!


On 13/09/2016 17:28, Schweitzer, Peter wrote:

In PostgreSQL, I store some whole documents as XML, using

create table something (
   rec_id integer,
   record xml

and then insert like this:

insert into something (rec_id,record) values ( 1,XMLPARSE (DOCUMENT
'<?xml version="1.0 encoding="UTF-8"?><...'));
By defining the field "record" as xml, I can use XML functions within
PostgreSQL to look at the contents (though I rarely do this).  But the
parsing step also catches improper XML and rejects the insert with an
error message, very helpful.

Is this the sort of information you're after?


On Tue, Sep 13, 2016 at 11:08 AM, Richard McDonnell
<> wrote:
Hello all,
I apologise if this is the incorrect forum for this question, but...
Im looking to create a table and I want to insert the xml as an attribute.
Anyone who uses the database stored styling in QGIS will have an idea what
Im on about.
I have thousands of these xml files and I want to insert the contents of
each file.
I have looked, but cant find it anywhere about the whole document in one
Any help appreciated.


OPW - Ag féachaint don am atá le teacht - Ag caomhnú ón am atá thart
OPW - Looking to the future - Caring for the past

Email Disclaimer:

Qgis-user mailing list
List info:

*_Richard McDonnell_*
*GIS Specialist PgD GIS AssocSCSI*
*OPW FRM Data Management*
*52 Stephens Green, Dublin 2.*
TEL: 01 6476543
Qgis-user mailing list
List info:

Reply via email to