DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: XML document well-formed and database

  1. #1
    Join Date
    Sep 2008
    Posts
    1

    XML document well-formed and database

    Hello everybody!
    I have a problem with XML and I really need your help. I have stored an XML file in a database that only accepts documents well formed, 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
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX

    I don't know of anything you can do with any kind of file (except delete it) without opening it.

    Can you split it up?

  3. #3
    Join Date
    Oct 2008
    Posts
    4
    you can use a php function to parse the object in 4kb (or specified) increments...How bad is the structure of the file? at 460MB file you're looking at a LOT of data, do you already know what needs to be corrected as you go? Or do you need to just chunk the file apart and fix individual pieces?

    The best way I know to do this is like I said in php using the $fp=fopen($filename) function to specify the file and the fread($fp, 4096); to parse it into 4kb increments until feof($fp)...

    This of course only works if you know the structure of the file...HOWEVER, you could also use this same method and pass it through a loop to export all the data to a seperate file...say your file is SUPER_LARGE.XML you could:

    $i = 0; //declarge a zero integer variable
    fopen(SUPER_LARGE)
    fread(SUPER_LARGE, 4kb)
    while(SUPER_LARGE still has information)
    {
    xport(SUPER_LARGE) buffer to SUPER_LARGE_ , $i , xml
    $i++; // increment i
    }
    fclose

    Obviously this is just a logic tree and the functions are totally different but it makes it readable so hopefull you can follow along

Similar Threads

  1. XML files vs Database
    By Mansoor in forum XML
    Replies: 8
    Last Post: 08-23-2002, 04:35 PM
  2. Problem Converting ADO Recordset to XML
    By CHRISTOS STAVRINOU in forum VB Classic
    Replies: 0
    Last Post: 11-16-2000, 05:58 PM
  3. Problem Converting ADO Recordset to XML
    By CHRISTOS STAVRINOU in forum Database
    Replies: 0
    Last Post: 11-16-2000, 05:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center