Re: p:replace

Norman Walsh wrote:
> p:replace takes a primary document, an XPath expression, and a
> document sequence and performs the following transformation:
> the first (in document order) set of contiguous nodes in the primary
> input document that matches the XPath expression is replaced with
> the contents of the first document in the document sequence.
> The second set of nodes is replaced by the second, etc., until
> all of the matched areas have been replaced.

This seems very complicated and error prone to me.

One technical problem that it does not address is that it
assumes the document sequence (e.g. replacement) can be produced
externally.

In all of my uses of my 'subtree' step in smallx, I take the
element that matched and use it to *produce* the replacement.  As
such, the above component, as described, would not work.

Also, this kind of component is practically impossible to stream.

--Alex Milowski

Received on Sunday, 30 July 2006 19:43:51 UTC