KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Note: Avoiding Problems Reading DOM XML Nodes
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: December 5, 2006
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

4th Dimension's DOM (Document Object Model) XML commands render a source XML document or variable as a tree of linked nodes. The DOM command set includes tools for navigating through the tree and reading information from nodes. The tree navigation commands, such as DOM Get Parent XML element and DOM Get first child XML element, use the OKsystem variable to indicate when the command has left the tree and reached a non-existent node. This feature makes it possible to navigate through the tree without knowing in advance exactly how many ancestors, siblings, or descendants a particular node has. However, it also leads to the navigationcommands returning references to invalid nodes. This creates problem when reading an element's name, value, or attributes. This technical note explains some simple strategies for managing bad nodes and avoiding problems.

Download Complete Tech Note and Example: Windows | Mac