Subject: [netmod] Consensus call (YANG types) - Canonical XPath

From: David Partain <[email-masked]>
Date: Fri, 17 Apr 2009 08:32:31 +0200

Do we need a definition of canonical XPath?

At the recent IETF, rough consensus was reached to look for an
existing canonical XPATH definition and reuse it if such exists.
Otherwise, we do nothing.  Put the canonical form (if found) in a
separate data type.

If you disagree with this consensus, speak now or forever hold
your peace.

D^2

---

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 17 Apr 2009 09:47:37 +0200

> Otherwise, we do nothing.  Put the canonical form (if found) in a

There is no such thing, at least not in the sense we need - see Martin's
message from 24 March.

Lada

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: David Partain <[email-masked]>
Date: Fri, 17 Apr 2009 10:02:35 +0200

> There is no such thing, at least not in the sense we need - see Martin's

Hi,

Yep, I know.  For those who need to look at it, see:

http://www.ietf.org/mail-archive/web/netmod/current/msg02289.html

This call simply reflects the need to confirm consensus on the mailing 
list :-)

Cheers,

David

---

From: "tom.petch" <[email-masked]>
Date: Tue, 21 Apr 2009 18:35:59 +0200

----- Original Message -----
From: "David Partain" <[email-masked]>
To: <[email-masked]>
Sent: Friday, April 17, 2009 10:02 AM
Subject: Re: [netmod] Consensus call (YANG types) - Canonical XPath

> http://www.ietf.org/mail-archive/web/netmod/current/msg02289.html

On the other hand, XPath 1.0 s.3.6 says

"Therefore, XPath expressions may return unexpected results unless both the
characters in the XPath expression and in the XML document have been normalized
into a canonical form. See [Character Model]."

which suggests to me that XPath 1.0 has a canonical form.

But reading the Provisional Meeting Minutes on this topic leaves me struggling
as to what the discussion is about.  I don't doubt that the minutes record what
was said but am unclear what is meant, that is, I am missing the link with the
datatype, seeing rather the issue as where Martin is quoted as saying

"Martin Björklund: Filtering keys, might not work?"

which sounds like the concern and then

"David Harrington: can xpath expressions be interpreted differently?

  Martin Björklund: nope"

which seems contradicted by the quote above.

Tom Petch

---

From: Phil Shafer <[email-masked]>
Date: Tue, 21 Apr 2009 13:56:24 -0400

"tom.petch" writes:
>...

The full section says:

    NOTE: It is possible in Unicode for there to be two strings
    that should be treated as identical even though they consist
    of the distinct sequences of Unicode abstract characters. For
    example, some accented characters may be represented in either
    a precomposed or decomposed form. Therefore, XPath expressions
    may return unexpected results unless both the characters in the
    XPath expression and in the XML document have been normalized
    into a canonical form. See [Character Model].

I read this as the _characters_ have a canonical form, not the
expressions.  This means that testing for equality, etc should have
both sides to have the same representation, or that the sw behind
the operators grok the differing representations.

I guess the really annoying thing is that the xpath spec leaves
open the possibility that one might _not_ normalize the characters
and this means xpath expresions are _allowed_ to return unexpected
results.  This seems like a mistake to not return normalization and
prevent unexpected results, but I didn't read the full discussion.

Thanks,
 Phil

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 21 Apr 2009 20:54:56 +0200 (CEST)

Hi,

> which sounds like the concern and then

What I meant was that if an XPath expression is used in the data
store, it might be difficult to filter (subtree, xpath) on its value.
For example if the value stored is "/child::interface" and the filter
string is "/interface" will the filter match?  There is also the
problem with prefixes, the XPath strings "/if:interface" and
"/x:interface" may mean the same thing if the prefixes "if" and "x"
are bound to the same URI.

And the problem exists without filtering; if an XPath expression is
used as key in a list, and I try to do an edit-config "delete" of the
list entry with key value "/child::interface", will the entry
"/interface" be deleted?

> which seems contradicted by the quote above.

I think the question was about when the expressions were executed.
There are many string representations of one XPath expression, but all
will evaluate to the same result.

/martin