473,508 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When loading tree structured XML file into postgresql is it necessary to remove the C

1 New Member
To illustrate the issue here is a very basic XML file that is structured with indents and has CR/LF characters.

<Book>
<Title>Database How To</Title>
</Book>

If I try to copy this into the postgresql database with the following sql.

COPY BOOKS from 'books.txt';

I get an error. "Entity: line 1: parser error : Premature end of data in tag Book."

I can successfully load the file if I structure the file differently so that all the xml is on one line as per below.


<Book><Title>Database How To</Title></Book>

This leads me to think that I need to unstructure the XML so each entry is on one line.

Is there any method to load without having to parse the file via "sed" to remove all CR/LF characters?
Aug 6 '13 #1
0 1386

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2291
by: Nick | last post by:
How to change the pic to a "show error" image when loading images failed - for example, no image file exists? I tried to add the following statement in the onload event function: if...
3
8478
by: Roy Wang | last post by:
hi, My problem is how to determining when the XML file has loaded using javascript. I loaded an xml file using javascript in a web page. The code below is loading the xml file for IE:...
5
3969
by: bissatch | last post by:
Hi, I have just managed to install DOMXML on my apache/PHP setup. I am running PHP 4.3.0 and Apache2. $xmldoc = domxml_open_file("inc/menu.xml", DOMXML_LOAD_DONT_KEEP_BLANKS); When I try...
4
6879
by: Matt Sawyer | last post by:
I am attempting to use an API (CxApiOem.dll) that has a large number of defines and complicated structs. It's just too much hassle to attempt to use DLLImport to make the desired API calls. ...
3
1872
by: Vivek Khera | last post by:
I have some historic data that I want to analyze. To do this I set up postgres on a spare box I picked up for cheap, which just lucked into having tons of RAM (1.5G). I set up postgres to use...
2
1338
by: Dave Alessi | last post by:
I migrated my project from VS 2003 to VS 2005. The application runs ok with a few exceptions, one being an ambigoius reference when loading a form. My application uses its own "master page"...
1
2836
by: FreeXenon | last post by:
OK, I am having a lot of problems loading an XML file via a Server-Side JavaScript based ASP page. Below is the code that I am using as well as the different methods of loading the XML file and the...
4
3365
by: FrankMeng | last post by:
When I tried to load 2GB tiff file, I got an "out of memory" error. I have 512MB memory, but I set virtual memory to 5GB. Is it possible to cut the big tiff file into several sub-images without...
3
2833
by: sandeep kumar shah | last post by:
I am facing one problem on loading the xml file The code is 1. XML file //attribute.xml <?xml version="1.0" encoding="UTF-8"?> <person> <name>sandeep</name> <address state="Goa �D;...
0
2068
by: ndedhia1 | last post by:
I am having trouble loading a property file and keep getting this error when running my shell script that loads and runs my jar files, etc: no property file loaded, using defaults......
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.