Hi again,
There's another place where namespaces declarations need to be
provided - the 'error-path' element. This is a bit different than the
other, since xpath is just used to point to an instance. But
namespaces need to be handled. I suggest that the namespace
declarations set is the namespaces in scope of error-path, so that an
agent can generate the following error-path:
<error-path xmlns:d="http://www.example.com/Datamodel">
d:top/d:users/d:user[name="fred"]/d:companyInfo/d:dept
</error-path>
/martin
Martin Bjorklund <mbj@tail-f.com> wrote:
> Hi,
>
> I know that this has been up on the list before, but I never saw any
> replies. The question is how to handle namespaces with the xpath
> capability. Consider the example in 8.9.5.1:
>
> <filter type="xpath"> <!-- get the user named fred -->
> top/users/user[name="fred"]
> </filter>
>
> If the box supports multiple namespaces, which namespace does top
> belong to? You could argue that this is a filter, so it should return
> results from all namespaces which match the filter. But what if you
> want to explicitly match a certain namespace?
>
> The XPath specification says that an xpath expression is evaluated
> with respect to a context
> (http://www.w3.org/TR/xpath#section-Introduction). A context
> contains, amongst other things, the set of namespace declarations in
> scope for the expression (a mapping from prefixes to namespace URIs).
>
> As one example, XSLT defines the context in
> http://www.w3.org/TR/xslt#section-Expressions. It defines the
> namespace declarations as:
>
> the set of namespace declarations are those in scope on the element
> which has the attribute in which the expression occurs; this
> includes the implicit declaration of the prefix xml required by the
> the XML Namespaces Recommendation [XML Names]; the default namespace
> (as declared by xmlns) is not part of this set
>
>
> I suggest that NETCONF uses a similar definition, so that one can
> write a filter such as:
>
> <filter type="xpath" xmlns:d="http://www.example.com/Datamodel">
> d:top/d:users/d:user[name="fred"]
> </filter>
>
> Also, I think that the XPath Core functions should be sufficient for
> NETCONF compliance; this is also not defined in the current draft.
>
>
> /martin
>
> --
> to unsubscribe send a message to netconf-request@ops.ietf.org with
> the word 'unsubscribe' in a single line as the message text body.
> archive: <http://ops.ietf.org/lists/netconf/>
--
to unsubscribe send a message to netconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>