Subject: Re: [Simple] Restricted XPath in xml-patch-ops

From: Jari Urpalainen <[email-masked]>
Date: Fri, 15 Feb 2008 12:10:43 +0200

ext Per Norrman wrote:
>
> Hello,
>
> The xml-patch schema defines the "xpath" and "xpath-add" type as 
> subsets of an XPath expression. The node types comment, text and 
> processing-instruction are valid node tests, but not the general 
> "node" type. Is there a specific reason why the node() construct is 
> not allowed?
>
yes, the design rule was to drop anything that can be lived without, so 
the defined operations are meant to provide the baseline only. The 
node() function is just overlap to *, text(), comment() and 
processing-instruction()
>
> I would argue that the node() construct allows for easier construction 
> of XPath expressions during the diff process, and for more efficient 
> node selection in the patch process, since it would not be necessary 
> to create a namespace binding for the XPath evaluation step.
>
> /per norrman
>
if you really want to avoid namespace scoping in selections,  the above 
node-specific selections (*, text() etc..) do _not_ require any 
namespace mangling. Also node() function would only be reasonable at the 
last evaluation step, so it is more reasonable to select 
"*/*[4]/*[3]/text()" than e.g. "*/node()[7]/node()[5]/node()[2]". So 
node() function is certainly shorter than e.g. the pi ;-) selection, but 
it still doesn't justify it's usage in the base spec.  So simplicity and 
the fact that it doesn't bring any real benefits were the reasons to 
omit it.

br, Jari
_______________________________________________
Simple mailing list
[email-masked]
http://www.ietf.org/mailman/listinfo/simple