[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subtree filtering question



Hi,

While reading the subtree filtering specs again, I found something
which is a bit unclear.

Consider this example from the draft.

     <filter type="subtree">
       <top xmlns="http://example.com/schema/1.2/config";>
         <users>
           <user>
             <name>fred</name>
           </user>
         </users>
       </top>
     </filter>

The question is what is the result if no user 'fred' exists?

Is it (1):

     <data>
     </data>

or (2):

     <data>
       <top xmlns="http://example.com/schema/1.2/config";>
         <users>
         </users>
       </top>
     </data>   

or maybe (3):

     <data>
       <top xmlns="http://example.com/schema/1.2/config";>
         <users>
           <user>
           </user>
         </users>
       </top>
     </data>   

Section 6.2.3 on containment node says:

   For each containment node specified in a subtree filter, all data
   model instances which exactly match the specified namespaces,
   element hierarchy, and any attribute match expressions are included
   in the filter output.

which seems to imply that alternative 3 is the right choice.  But in
section 6.3. it says:

   If the entire subtree data-fragment filter (starting from the root
   to the innermost element specified in the filter) exactly matches a
   corresponding portion of the supported data model, then that node
   and all its children are included in the result data.

Which seems to indicate that alternative 1 is right.  This might also
be implied by the text on content match nodes:

   o  If any containment nodes are present in the sibling set then they
      are processed further, and included if any nested filter criteria
      are also met.

(although this only seems to apply to containment nodes which are
siblings to content match nodes)


/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/>