OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sca-policy message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [sca-policy] Suggested resolution to issue 87


Hi Ashok,

I have a different opinion on the XPath-ness of appliesTo="sca:binding.ws". I'm going to assert that it's perfectly valid, and even better it is precisely correct. I ran this by my XPath expert and he has come to the same conclusion as I have. I'll try to explain:

Your line numbers don't match up with my cd02-rev4 pdf, but I think I know which text you're referring to. We're interested in section 3.4 PolicySets, following the example (lines 383 - 399).

The way I read the current text is that the XPath expression is supposed to be evaluated with service, reference and component elements (lines 393 - 395) as the root context. This statement establishes the XPath context before an XPath processor evaluates the appliesTo expression. As a means for playing with examples, I used the XPath expression test bed here: http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm

a) click the "Define context set" check box
b) enter "//child" in the Context Set entry field.....without the quotes.
c) enter "grandchild" in the XPatch Expression window.....without the quotes.
d) click evaluate

The result is 4 grandchild elements. No preceding slashes are necessary because of the use of a root context for expression evaluation.

//grandchild also works; BUT
1) '//' is more expensive at runtime because it searches the whole document, thus I don't want to force users down this path (pun intended).
2) '//' ignores the context we've defined. We don't want the expression to return anything but elements that can potentially be configured by a policySet, but the use of '//' opens up the possibility that other stuff might get dragged into the result set.

The test bed tool allows you to feed in your own XML document instances if you want to play with some more examples.

WRT your question on @attachTo, section 4.4.1 "The Form of the @attachTo Attribute" clearly says that the root of XPath evaluation is the "InfoSet for External Attachment" and then goes on to explain in some detail. In these cases, @attachTo="//someElment" would seem to be equivalent to "someElement" since evaluation always starts at the root of the infoset, which BTW is not a composite document.

In conclusion, I think we can close ISSUE-87 with no action.


Dave Booz
STSM, BPM and SCA Architecture
Co-Chair OASIS SCA-Policy TC and SCA-J TC
"Distributed objects first, then world hunger"
Poughkeepsie, NY (845)-435-6093 or 8-295-6093
e-mail:booz@us.ibm.com

Inactive hide details for ashok malhotra ---09/03/2009 10:26:45 AM---On line 427 on CD02 Rev 4 Change appliesTo="sca:binding.wsashok malhotra ---09/03/2009 10:26:45 AM---On line 427 on CD02 Rev 4 Change appliesTo="sca:binding.ws"


From:

ashok malhotra <ashok.malhotra@oracle.com>

To:

oasis policy <sca-policy@lists.oasis-open.org>

Date:

09/03/2009 10:26 AM

Subject:

[sca-policy] Suggested resolution to issue 87





On line 427 on CD02 Rev 4
Change appliesTo="sca:binding.ws"
To appliesTo="//sca:binding.ws"

This will apply the policy set to all occurrences of sca:binding.ws at
any level.
This solves the problem but you may wonder why not /sca:binding.ws which
would apply to sca:binding.ws
child elements. This would also work but see discussion below.

Change lines 454 to 461 as below:

With this design principle in mind, an XPath expression that is the
value of an @appliesTo attribute designates what a policySet applies to.
Note that the XPath expression will always be evaluated within the
context of an attachment considering elements where binding instances or
implementations are allowed to be present. The expression is evaluated
against /the parent element of any binding or implementation element/.
The policySet will apply to any child binding or implementation elements
returned from the expression. So, for example, appliesTo=”//binding.ws”
will match any web service binding. If
appliesTo=”//binding.ws[@impl=’axis’]” then the policySet would apply
only to web service bindings that have an @impl attribute with a value
of ‘axis’.

Q1: Why the rule "The expression is evaluated against /the parent
element of any binding or implementation element/."
Since the policySet can be attached to any element in the SCDL how do we
find the parent element?
Why not evaluate the XPath against the root of the SCDL document.
Surely, this is what we would want for
@attachTo.

Q2. While there is considerable discussion re @appliesTo there is no
discussion wrt @attachTo. Did we just miss adding
that when we added @attachTo?
--
All the best, Ashok

---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail.  Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php 





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]