F77xml library

Back to index

Draft for 1.0 release

This is a draft for the upcoming 1.0 version, which plans to outdate the current test release 0.x.

Calls to DOM functions

The upcoming 1.0 release is more DOM2 compliant. The concept of unit will be removed, since we can refer to every object in the dom tree, included the DomDocument itself, with the numeric ID returned by an opportune createDocFromURI, in resemble to gdome2 style. Moreover, every object managed by f77xml will have a numerical ID, even strings.

For the calling convention, I choose a more useful approach. For example, suppose we have the function gdome_el_firstChild. The prototype for this function is
GdomeNode*  gdome_el_firstChild  (GdomeElement *self, GdomeException *exc);

Our objective for the 1.0 release is to create subroutines for f90 that can be rewritten as f77 calls from the preprocessor. For this reason, the hypothetical f90 subroutine is in the form:

call f77xml_object_function(return,arguments,error)

Thus, for example, the gdome_el_firstChild is mapped as

call f77xml_el_firstChild(nodeCode,elemCode,err)

since nodeCode is an integer, we could rely on functions, instead of subroutines. This is a debatable argument.
The mapping to f77 will:
  1. parse the f77xml_el_firstChild(nodeCode,elemCode,err)
  2. extract the el_firstChild
  3. extract the first argument (nodeCode) which is the return value
  4. extract the remaining arguments (elemCode,err)
  5. lookup the el_firstChild in the signature database. This returns p3t1
  6. create the code as
        call xp3t1(nodeCode,func,elemCode,err)

Please note that the 1.0 are different from the 0.x signatures. Also please note that all string (except function names for multiplexing) are identified by codes.
This means that you need to write, for example
   integer str1,elem1,err
   integer doc ! the domDocument object
   call f77xml_str_new(str1,'hello',err)

   call f77xml_doc_createElement(elem1,doc,str1,err)

Although all these changes seems to destroy what i stated in the first draft, this new approach carry a lot of improvements:
  1. there's a clean correspondence between the gdome2 functions and the f77xml ones
  2. the namespace pollution is even more reduced, since c|se type functions now are c|ce.
    Please note that i divide the return value from the parameters using a pipe |
  3. Managing string is no more an issue. The returned object can be queried for length, or for substring, for example. A set of subroutines is implemented to support string management.