When a tree is loaded into memory, if 'sendMessages' is true, then on the creation of each XML node and XML data element a 'revStartXmlNode' or 'revStartXmlData' message is sent. In the case of the former, pNodeName and pAttributes are also sent with the message. However, I think in many cases it would be more useful if the tree id and the full-path to that node was also sent.
As things currently stand I think the usefulness of these two messages is limited. For example, if the messages received the additional data I'm suggesting it would be much simpler to load a tree from file, and apply some processing to either the attributes or the data as each part of the tree was being processed (i.e. as each message was received). As it is, without being able to identify which tree and which precise node is beint processed, I cannot see that the current message is of much use. The pNodeName that currently is received is only the last part of the path to the node, so it is basically ambiguous and cannot be used to get a handle on that node.
I'd like to know if other people agree with this before I enter it as an enhancement request in BZ.
rexXML enhancement - please comment
Moderator: Klaus
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
rexXML messages
Hi Bernard,
The message sending system is meant to complement the DOM model (where an entire tree is loaded into memory) with the SAX model (where you get a stream of messages and do what you need with the subset of data that you get).
The DOM model is memory-intensive, whereas the SAX model allows you to read a giant XML structure piecemeal. In the SAX model you process the data as it comes by; granted, getting the complete path as the third parameter might be nice, but you can track the current hierarchical location yourself.
Jan Schenkel.
The message sending system is meant to complement the DOM model (where an entire tree is loaded into memory) with the SAX model (where you get a stream of messages and do what you need with the subset of data that you get).
The DOM model is memory-intensive, whereas the SAX model allows you to read a giant XML structure piecemeal. In the SAX model you process the data as it comes by; granted, getting the complete path as the third parameter might be nice, but you can track the current hierarchical location yourself.
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
-
- Livecode Opensource Backer
Re: rexXML enhancement - please comment
Hi Bernard,Bernard wrote:However, I think in many cases it would be more useful if the tree id and the full-path to that node was also sent.
In case this is of any help, I uploaded this XML library of my own. In particular check out the function : tree.PathOfNode
This is in no way meant to be a professional quality library like revXML. It is simply something I designed to meet my own needs.
Share alike license. Feel free to improve... and share your improvements with others.