DOM Tool Kit

Working with the DOM ABL statements can be a bit grueling. This tool kit makes four easy to use procedures and functions to read any given instance of an XML document tag's data or it's attributes based on the ideas found in Javascript.

A sample use:

Given

 
<?xml version="1.0" ?>
<Books>
  <Book>
     <Title subject="SciFi" entry="one">War OF The Worlds</Title>
  </Book>
  <Book>
     <Title subject="SciFi" entry="two">Battlestar Galactica</Title>
  </Book>
  <Book>
     <Title subject="SciFi" entry="three">Star Wars</Title>
  </Book>
</Books>


RUN DOMParse.p PERSISTENT SET hDOM.

RUN LoadXMLDoc IN hDOM ("\\osxlaptop\scottauge\Desktop\DOM\test.xml").
RUN GetError IN hDOM (OUTPUT cErr).
IF NOT cErr BEGINS "000" THEN DO:
DISPLAY cErr.
RETURN.
END.

RUN NumOfTags IN hDOM ("Title", OUTPUT iCount).

RUN getElementByTagname IN hDOM ("Title", 2, OUTPUT cData).
DISPLAY cData.

RUN getAttributeByTagname IN hDOM ("Title", 2, "entry", OUTPUT cSubject).
DISPLAY cSubject.

DISPLAY iCount.

DELETE OBJECT hDOM.

Where to find it?
http://www.oehive.org/amduus/DOM/