If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 and XML document well-formed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-15-08, 10:38
aletibe aletibe is offline
Registered User
 
Join Date: Aug 2008
Posts: 2
DB2 and XML document well-formed

Hello everybody!
I have a problem and I really need your help. I have stored an XML file in DB2 (IMPORT), unfortunately my file is very large, about 460 MB, and is therefore impossible to open it with XML editor, correct it and make it well formed.
Are there programs in java or tools that allow to make a document well formed without open it with an editor?
How can I do?
Thank you very much in advance for all of your help, please mind it’s really important!
Reply With Quote
  #2 (permalink)  
Old 09-15-08, 14:28
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Do you know what's missing or otherwise wrong with the file?
Suppose it just misses a closing tag at the end, then it's easy: just add the missing part (by using CONCAT in DB2):
Code:
UPDATE my_table SET my_col = my_col || '</my_tag>' WHERE .....
Otherwise it would take some (Java or perl or so) programming effort to extract just the tags, then edit that to see where it goes wrong, then write an other program to insert the missing pieces.

Possible perl script to do the first part above:
Code:
#! perl -0p
s/>.*?</>\n</gs;
Or of course, consider using the new (v9) xml datatype -- then you'll never be able to store non-wellformed XML in DB2!
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On