The development of the parser to date has focused on the ability to serialize a SAM document to XML. This does not require any kind of reference back into the document model because all such references are postponed to the application layer.
However, when coding the HTML output mode it became clear that the HTML output mode would be more useful if certain reference could be resolved for output. This includes:
Turn reference by ID into links.
Resolve internal string refrences
Resolve internal fragment references (which amount to a more general resolution of object references)
In trying to code this, it became clear that the current object model does not make it easy to make query the document model, particularly from inside an object within that model.
There are different types of objects in the object model but there are certain operations you want to be able to do regardless of type. These include parent and child access and retrieving objects by id or name. This may call for a base object from which all DOM objects are derived.
I also think that it would be easier if attributes like ID and name were attributes of the blocks they belong to rather than being a collection of attribute objects. This would make access by ID much simpler.
The development of the parser to date has focused on the ability to serialize a SAM document to XML. This does not require any kind of reference back into the document model because all such references are postponed to the application layer.
However, when coding the HTML output mode it became clear that the HTML output mode would be more useful if certain reference could be resolved for output. This includes:
In trying to code this, it became clear that the current object model does not make it easy to make query the document model, particularly from inside an object within that model.
There are different types of objects in the object model but there are certain operations you want to be able to do regardless of type. These include parent and child access and retrieving objects by id or name. This may call for a base object from which all DOM objects are derived.
I also think that it would be easier if attributes like ID and name were attributes of the blocks they belong to rather than being a collection of attribute objects. This would make access by ID much simpler.