@ifplaintext
\input texinfo
@settitle Document Object Model for APL
@setfilename dom.txt
@copying
This manual is for workspace assert version  0 1 2.

Copyright @copyright{} 2019 Bill Daly

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
@end copying

@titlepage
@title Document Object Model for APL
@author Bill Daly

@end titlepage

@ifnottex
@node TOP
@end ifnottex

@end ifplaintext

@ifnotplaintext
@node dom
@end ifnotplaintext

@chapter Document Object Model for APL
@cindex dom --- Document Object Model for APL
@cindex Document Object Model

This workspace provides an incomplete implementation of w3.com's
Document Object Model (DOM).  The DOM creates and manipulates a graph
database from an xml file. The specification leans heavily on object
oriented programing constructs.

This implementation provides a functional programming model with a
function naming scheme to identify the objects in the
specification. So that functions in the dom∆node family are methods
specified for the node object and dom∆document functions are methods
specified for the document object. Creation methods require a left
argument of the name of the document variable, an idea not fully
implemented in this version.

The graph database design departs from the DOM in
that children of a node are stored in an apl vector and the node
methods firstChild, lastChild and nextSibling have not yet been
implemented.

Traversal of the graph is best illustrated by the function
dom∆node∆toxml. That function recursively traverses the graph
returning the variable xml, viz.:

@verbatim
      xml←xml,∊dom∆node∆toxml ¨ dom∆node∆children node
@end verbatim           

To build a DOM use dom∆parse:

@verbatim
      )copy 5 FILE_IO
      dv ← 'dv' dom∆parse FIO∆read_file 'ADom.xml'
@end verbatim

To look at a DOM graph use dom∆node∆toxml:

@verbatim
      ⍞←dom∆node∆toxml node
@end verbatim


