Subject: [netmod] FW: Request for help with a NETMOD question

From: "David Harrington" <[email-masked]>
Date: Wed, 15 Oct 2008 16:15:50 -0400

Can somebody remind me why we are not using XPath 2.0?
Would that resolve this issue satisfactorily?

dbh

-----Original Message-----
From: Lisa Dusseault [mailto:[email-masked]] 
Sent: Wednesday, October 15, 2008 3:00 PM
To: David Partain
Cc: Chris Newman; David Harrington; Dan Romascanu; Ron Bonica
Subject: Re: Request for help with a NETMOD question

I have no idea what the answer is myself. I do note that the  XSLT  
spec you reference ten years old.  Have you tried looking at XPath 2.0

and its errata?
http://www.w3.org/TR/2007/WD-xpath-full-text-10-20070518/

So, looking around for who could help you, I don't know anybody with  
XPath expertise.  Frustratingly, at the W3 web site, I can't find out

who is active in XML/XSL at this time -- the XSL WG page is readable  
to members only.  The XPath spec does list contributors, so there's a

bunch of names of experts there.  I don't know any of them.

We could certainly route a query through the IETF's W3C liaison if  
you'd like.  That could work but it could be slow.

Lisa

On Oct 15, 2008, at 1:11 AM, David Partain wrote:

> Greetings,
>
> A question has been raised in the NETMOD Working Group about the way

> the
> current YANG draft defines the context in which XPath expressions
are
> evaluated.
>
> YANG defines data models using constructs like "leaf"s and  
> "container"s.
> Constraints are defined using "must" expressions, which use the  
> XPath 1.0
> syntax.  For example, this snippet defines a container whose "max"  
> cannot
> exceed the "min":
>
>   module test-case {
>       namespace http://example.com/yang/test-case;
>       prefix tc;
>
>       container limits {
>           must "min < max";
>           leaf min { type uint32; }
>           leaf max { type uint32; }
>       }
>   }
>
> The "must" expression is defined as being evaluated in a context  
> where the
> current module is the null namespace, so unqualified nodes refer to

> the
> locally defined nodes.
>
> This allows a natural syntax where the "must" statement uses the
same
> unqualified syntax as other YANG statements like the "leaf"
statement.
>
> The question is whether this definition of the null namespace  
> constitutes
> breaking the rules defined in XPath 1.0.  XPath allows standards  
> such as XSLT
> and XPointer to define such a context.  For example, see the rules  
> for XSLT
> contexts in section 4 of the XSLT spec:
>
>   http://www.w3.org/TR/xslt.html#section-Expressions
>
> The XSLT spec specifically calls out the default namespace as not  
> being
> carried into the context, meaning the default namespace is always  
> the null
> namespace.
>
> XPath 2.0 allows the default namespace to be set, addressing this  
> issue.
>
> XML-PATCH-OPS (RFC 5261) defines their expressions as namespace- 
> agnostic,
> allowing unqualified nodes to match nodes regardless of the  
> namespace.  This
> is covered in the section "Departures from XPath  
> Requirements" (section
> 4.2.2).
>
> So the question is: does defining the context to include the null  
> namespace as
> being the current module violate XPath 1.0?
>
> We would be grateful if you could provide some guidance or point us

> in the
> direction of those who can.
>
> Thanks very much.
>
> David and David

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Phil Shafer <[email-masked]>
Date: Wed, 15 Oct 2008 16:26:38 -0400

>Can somebody remind me why we are not using XPath 2.0?

XPath 2.0 increased the size of both the spec and implementation
by at least double.  Saxon (Java) is the only implementation IFAIK.

The libxml2 folks see no value to xpath 2.0 and there's no interest
in implementing it.  libxml2 is the engine used in C, Perl, PHP,
Python, and other languages.

So mandating 2.0 means mandating Java, which is a non-starter.

XPath 1.0 is a subset of 2.0, so we can move forward when and
if the marketplace moves to 2.0.

Thanks,
 Phil