[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
namespaces in subtree filtering
Andy noted at the meeting that subtree filtering can't be used to
retreive elements from mulitple namespaces.
The text from rfc4741, section 6.2.1 says:
If namespaces are used, then the filter output will only include
elements from the specified namespace. A namespace is considered to
match (for filter purposes) if the content of the 'xmlns' attributes
are the same in the filter and the underlying data model.
This is somewhat difficult to interpret. What exactly does "the
'xmlns' attributes" mean? Note the plural.
Suppose we have this in the database:
<if:interfaces xmlns:if="http://example.com/interface">
<if:interface>
<if:ifIndex>1</if:ifIndex>
<if:ifType>ds0</if:ifType>
<ds0:circuitIdentifier xmlns:ds0="http://example.com/ds0">foo</ds0:circuitIdentifier>
</if:interface>
</if:interfaces>
Accordning to the example in 6.2.1, the following filter:
<get>
<filter>
<if:interfaces xmlns:if="http://example.com/interface"/>
</filter>
</get>
would return
<if:interfaces xmlns:if="http://example.com/interface">
<if:interface>
<if:ifIndex>1</if:ifIndex>
<if:ifType>ds0</if:ifType>
</if:interface>
</if:interfaces>
Suppose instead the filter is
<get xmlns:if="http://example.com/interface">
<filter>
<if:interfaces/>
</filter>
</get>
Note that no xmlns attributes are present in the filter itself.
Would we get the ds0 elements as well?
What about this filter:
<get>
<filter>
<if:interfaces xmlns:if="http://example.com/interface"
xmlns:ds0="http://example.com/ds0"/>
</filter>
</get>
Here we have two xmlns attributes. Would we get the ds0 elements in
this case?
IMO, it's unfortunate that the xmlns attribute is overloaded with this
filter semantics. I don't really see the value in this namespace
selection mechanism at all. Are there any use cases where it makes
sense?
/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/>