[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Simple] triggers in filter-format drafts selecting multiple elements - problem?
>There is only one <status> element in a tuple, so I don't see how this
>would happen in this case. But I say if a trigger filter selects 2
>elements, then its an error.
I don't understand it now. In the draft is explicitly stated that the
XPATH-like selector may select multiple elements and that all identified
elements are selected.
Example:
<changed>//tuple/status/basic
</changed>
Before change:
<tuple id="1">
<status>
<basic>open</basic>
</status>
<contact>sip:im at example.com</contact>
</tuple>
<tuple id="2">
<status>
<basic>closed</basic>
</status>
<contact>sip:poc at example.com</contact>
</tuple>
After change (note that also the order has changed):
<tuple id="2">
<status>
<basic>open</basic>
</status>
<contact>sip:poc at example.com</contact>
</tuple>
<tuple id="1">
<status>
<basic>closed</basic>
</status>
<contact>sip:im at example.com</contact>
</tuple>
Filter selects:
<basic>open</basic>, <basic>closed</basic> before change
<basic>open</basic>, <basic>closed</basic> after change
How do we know which elements should we compare? Do we take into
consideration the parent path to each element? That would bring another
problem - are 2 equal <basic> elements selected by a wildcard-trigger
equal if they have different parents?
-----Original Message-----
From: Hisham Khartabil [mailto:hisham.khartabil at telio.no]
Sent: Wednesday, February 15, 2006 3:45 PM
To: Peknik Silvestr
Cc: simple at ietf.org
Subject: Re: [Simple] triggers in filter-format drafts selecting
multiple elements - problem?
On Feb 15, 2006, at 2:11 PM, Silvestr.Peknik at tietoenator.com wrote:
> Hello, again a question about filtering.
>
> Draft-ietf-simple-filter-format-05 describes triggers defining
> conditions under which notifications are sent. Lets take the <changed>
> trigger:
>
> "The <changed> element is used to identify the XML element or
> attribute, from the package specific XML document, whose value MUST
> change, compared to the "previous XML document", in order to
> activate
> the trigger and cause the content to be delivered."
> ...
>
> It is also written that the elements can identify more than one
> element:
>
> " In some cases, due to the design of the XML schema, the XPATH-like
> expression results in identifying more than one element with the
> same
> name (the XPATH expression may not have uniquely identified an
> element at every step). In those cases, all elements identified
are
> selected."
>
> What happens if I have trigger defining change from "open" to "closed"
> for some <status> element, and the XPATH-like expression selects more
> than one element? One can be changed from "open" to "closed", the
other
> from "closed" to "open.
There is only one <status> element in a tuple, so I don't see how this
would happen in this case. But I say if a trigger filter selects 2
elements, then its an error.
> Similarly, if the selector in <added> element
> selects one element in previous document and 2 elements in current
> document, is it a match?
There is something wrong in the filter if one already existed. I doubt
there will be examples where this would happen.
Hisham
_______________________________________________
Simple mailing list
Simple at ietf.org
https://www1.ietf.org/mailman/listinfo/simple