[cxml-devel] Inconsistency in creating %children vector

Raymond Wiker rwiker at gmail.com
Mon Jul 9 18:39:24 UTC 2012


I was scratching my head for a couple of hours today, because of an apparent failure of cxml-dom::make-space - it did not increase the size of the %children vector. On closer examination, it turned out that the reason was that the %children vector was not adjustable, at that point.

The only places in cxml-stp where %children is set up are in %unchecked-insert-child (parent-node.lisp) and normalize-text-nodes! in xpath.lisp. The first of these has (make-array ... :adjustable t ...), while the other does not. My guess is that normalize-text-nodes! might be called as part of an xpath evaluation, and if this happens in code that is actually building the cxml-stp structure, the result might be a situation where the %children vector is not adjustable.

I'm not sure if this is a valid use of cxml-stp/xpath, but there is at least one documented case where it has been done :-)

I could (trivially) change my code to not use xpath as part of the construction process, but adding :adjustable t to the call to make-array in xpath.lisp makes my (current) code work, and I guess it also makes cxml-stp slightly more robust.






More information about the cxml-devel mailing list