massive xml docs
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu Feb 9 03:22:14 EST 2006
On 2/9/06 10:02 AM, "Ken Ray" <kray at sonsothunder.com> wrote:
>>> If I read it correctly, the answer is "no" - basically, with "true" as the
>>> last param, you're telling the DLL to send you a message when it's about to
>>> start parsing the tree, when it encounters each node (so you can extract
>>> attributes from the node) and when it encounters data for the node. So you
>>> write your own code to work with the XML data as it's being parsed...
>>>
>> hmmm... that may be perfect for what I need to do, since I don't need
>> to parse the whole document, just the parts the user is interested
>> in. It is unlikely that user will ever need to get at the vast
>> majority of the data in there.
>
> Yes, and now that I see how this works, I'll add it to my XML Library too...
Ken, Todd.
I think something wrong here.
IF revCreateXMLTree() will not build DOM then it will work as SAX.
Ken write:
- it will send you event on each tag -- this is SAX.
- you need write own code to handle tags, attributes, dat -- this is SAX.
Todd, You CAN NOT parse only PART of XML.
XML this is text document. You (actually not you but XML parser) MUST load
and read it byte after byte sequentially. You see?
-------------------------------------------------------------------------
already was mentioned:
* SAX
adv
- is good for ONE iteration on XML document
- eat low RAM
- so can be used for huge XML documents. But again only one
iteration. E.g. Transformation of one XML doc into other
disadvantages:
- develop need write many code to handle tags
- bad if needed do many iterations
* DOM
adv
- is good for MANY iterations down and top
- easer code to use
disadvantages:
- eat a lots of RAM
- limited to documents that fit RAM.
-------------------------------------------------------------------------
Todd, you have point you need FAST speed.
If you think that 500Mb of RAM is okay for your app then go with DOM.
IF that is okay you need special tools.
Also in ideal these tools must be able handle queries to XML document.
This can be Xpath, Xquery, or SQL/XML.
You have no other options.
Another important question:
Do you have STATIC XML document? data are fixed?
you will send this to many your users ?
or each user will have own document?
IF you have static document, then you need simply parse it ONCE and load
data into database. IF you have static document then no sense parse it
millions times on each query.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the use-livecode
mailing list