This type provides additional functionality for the built-in XML type, making it easier to retrieve values from XML documents when the structure is known. It adds the following new member tags:
->atts - Returns a map of the attributes for the current node, instead of an array of pairs.
->attribute(string) - Returns the value of the given attribute for the current node.
->nodename(index) - Returns the given child node by name. If there are multiple nodes of the same name, you can return a specific node by passing an index. If no matching child nodes are found, it will look for an attribute by that name.
->getnode(string) - Same as ->nodename above. Useful if the node name conflicts with an existing member tag, such as "name."
->getnodes - Returns the children of the current node, minus the empty ones that ->children generates on its own.
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.
08/30/2009, Jason Huck Bug fix for ->getnodes().
Corrected an issue with ->getnodes(). Thanks to Steve Piercy for discovering the bug and providing the workaround.
06/17/2006, Jason Huck Update
Modified ->getnode() member tag to use an XPath expression instead of ->children for better performance/memory management, per a suggestion by Kyle Jessup.
06/01/2006, Jason Huck Update
The _unknowntag callback now searches for matching attributes if no matching child nodes are found.
05/30/2006, Jason Huck Updates
Added ->getnodes member tag and made more things return via reference.
05/17/2006, Jason Huck Added ->getnode() member tag.
You can now use ->getnode() to access nodes with otherwise conflicting names.
05/08/2006, Jason Huck Bug Fix
Added error trapping on ->attribute member tag.
Bug fix for ->getnodes().
Corrected an issue with ->getnodes(). Thanks to Steve Piercy for discovering the bug and providing the workaround.