Renaming 'target' and handling "inner" matches

We've all stated that we want to rename the 'target' option for XPaths.
Here are
the steps that have this option:

   p:delete
   p:insert
   p:rename
   p:replace
   p:unwrap
   p:wrap

We've gotten to the point where some have agreed that we should call
this option 'match' and use match patterns.

On the call, I think Henry noted that it doesn't matter whether we call
it 'match' or 'select' because we still need to define what the step does
with "inner" matches.   That is, "div" or "//div" still can match a div
inside
a div and so our steps must define what they do in those situations.

Some steps consume their targets and so the case of inner matches goes
away:

   p:delete
   p:replace

The rest have definable semantics for handling inner matches:

  * p:insert - it is well defined where the insertion happens for each
    match regardless of whether one is contained in another.  The canonical
    example here is inserting a paragraph into every 'div' in an XHTML
document.

  * p:rename - Renaming an element doesn't affect its child.

  * p:unwrap - Removing an element wrapper doesn't affect its children.

  * p:wrap - Added an element wrapper doesn't affect its children.


-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Sunday, 29 April 2007 21:33:34 UTC