From: | Edwin Plauchu <pianodaemon(at)gmail(dot)com> |
---|---|
To: | Erwin Brandstetter <brsaweda(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Import data from XML file |
Date: | 2009-08-26 16:41:50 |
Message-ID: | bf1c3abe0908260941y4e05f012x7e410233593ec61@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I think.. you'll need to parse that one...
Where do you have your data types to xml document ?
2009/8/26 Erwin Brandstetter <brsaweda(at)gmail(dot)com>
> Hi!
>
> How do you import data from an xml-file?
> For instance, if I have a file like this:
>
> <?xml version="1.0" encoding="utf-8"?>
> <p_update>
> <main_categories>
> <main_category>
> <main_category_name>Sonstiges</main_category_name>
> <main_category_id>5</main_category_id>
> </main_category>
> <main_category>
> <main_category_name>Buehne</main_category_name>
> <main_category_id>2</main_category_id>
> </main_category>
> <main_category>
> <main_category_name>Konzerte</main_category_name>
> <main_category_id>1</main_category_id>
> </main_category>
> </main_categories>
> <categories>
> <category>
> <category_name>Reggae</category_name>
> <main_category_id>1</main_category_id>
> <category_id>45</category_id>
> </category>
> <category>
> <category_name>sonstige</category_name>
> <main_category_id>5</main_category_id>
> <category_id>44</category_id>
> </category>
> </categories>
> </p_update>
>
>
> ... and I want a CSV file like this:
>
> main_category_name main_category_id
> Sonstiges 5
> Buehne 2
>
> category_name main_category_id category_id
> Reggae 1 45
> sonstige 5 44
>
>
> Or is there a way to import directly into tables in a postgres
> database?
>
>
> Your help would be appreciated!
> Regards
> Erwin
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
From | Date | Subject | |
---|---|---|---|
Next Message | imageguy | 2009-08-26 17:12:02 | PG 8.2 instal on Win2k3 - unable to connect to test network socket |
Previous Message | John R Pierce | 2009-08-26 16:39:26 | Re: Import data from XML file |