Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008

    Unanswered: 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!

  2. #2
    Join Date
    Sep 2004
    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):
    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:
    #! perl -0p
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts