Best way to import XML Files
Fairlight
fairlite at fairlite.com
Mon Jun 14 22:30:50 PDT 2004
This public service announcement was brought to you by George Simon:
> I have to import and process several XML files at a time. What I'm
> planning to do now, since I don't know the name of the files, is:
> copy *.xml big.xml and parse the big.xlm file. Since there are no
> single-character field and record delimiters, what is the best way to
> import this big.xml file?
Hi George,
As John pointed out, you're going to have issues with merging them the way
you notated it. Unfortunately, John gave you *nix Bourne syntax, and
you're a Windows user, if memory serves. There are a bunch of ways to
concatenate the files. I don't see that as being the huge issue.
I think you're concerned about how to actually parse the XML.
Without selling you example source code (mine's commercial and
purpose-specific), the best I can tell you is to use:
open()
close()
readline()
tell()
filesize()
len()
instr()
mid()
...And use loops and state-tracking variables. :)
Now what order you put those in and the logic you use is key to how you
actually parse it out, but given the functions and hints I listed, I think
you can figure it out fairly well if you know XML.
It can be done quite readily with those functions and the right logic,
mark->
--
Bring the web-enabling power of OneGate to -your- filePro applications today!
Try the live filePro-based, OneGate-enabled demo at the following URL:
http://www2.onnik.com/~fairlite/flfssindex.html
More information about the Filepro-list
mailing list