p:replace

Having described for-each, I spent some time trying to decide how to
describe p:viewport or p:peephole. In the end, I decided it was really
hard to do given that there may be multiple documents on any given
pipe. I think we can describe such an element if we want to, but I
convinced myself that Richard's suggestion at the last telcon of
another component for this purpose was a cleaner solution.

I imagine the p:replace element, or whatever we call it, would have
the following signature:

  <p:declare-component name="p:replace">
    <p:declare-input port="input"/>
    <p:declare-input port="replacement"/>
  </p:declare-component>

I'm sort of imagining the select attribute would be on the p:replace
element, which means we'll have to find some way of declaring that in
a component declaration.

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.

It is an error if number of matches is not the same as the number
of documents in the document sequence.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Saturday, 29 July 2006 21:15:54 UTC