sca-assembly message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: What is the form of an @source XPath expression where the source propertyis multi-valued?
- From: Mike Edwards <mike_edwards@uk.ibm.com>
- To: "OASIS Assembly" <sca-assembly@lists.oasis-open.org>
- Date: Wed, 21 Jul 2010 10:56:46 +0100
Folks,
OK, here is an interesting question.
SCA component properties support a @source
attribute which indicates that the value for the property is obtained from
the value of a property of the containing
composite. The source attribute takes the general form of an XPath
expression,
but starting with "$composite_property_name",
which indicates the name of the composite property to use, and which
logically implies the "XML document"
on which the remainder of the XPath expression operates.
For example:
<property
name="complexType"
type="test:ComplexType1"/>
<component
name="TestComposite12Component1">
<implementation.composite
name="test:TestComposite71"/>
<service
name="Service1"/>
<property
name="serviceData1"
source="$complexType/test:firstData/text()"/>
</component>
If the composite property is multi-valued
(i.e. @many = "true"), what should be the form of the XPath expression
in the @source attribute?
<property
name="complexType"
many="true"
type="test:ComplexType1">
<value>
<firstData>Sample
first data</firstData>
<secondData>Sample
second data</secondData>
</value>
<value>
<firstData>Alternate
first data</firstData>
<secondData>Alternate
second data</secondData>
</value>
</property>
<component
name="TestComposite76Component1">
<implementation.composite
name="test:TestComposite71"/>
<service
name="Service1"/>
<property
name="serviceData1"
source="?????"/>
</component>
In this case, the composite property
contains an array of values.
So, does this imply that the right way
to approach this for the @source XPath expression is as follows:
$complexType
--> the whole array of values
$complexType[1]
--> the first value in the array
$complexType[n]
--> the nth value in the array
$complexType[n]/test:firstData/text()
--> the
text in the firstData element of the nth value in the array
and I suppose that since the [...] syntax
in XPath is actually a Predicate rather than simply an array index, this
can imply other expressions being contained
within the brackets, such as @foo="bar", which would select
the value elements in the array which
happen to have thier @foo attribute set to "bar".
I am asking this since our spec is silent
on this point and our @source expression format is not straight XPath
but has this twist of having the target
property name at its root.
Yours, Mike.
Strategist - Emerging Technologies, SCA & SDO.
Co Chair OASIS SCA Assembly TC.
IBM Hursley Park, Mail Point 146, Winchester, SO21 2JN, Great Britain.
Phone & FAX: +44-1962-818014 Mobile: +44-7802-467431
Email: mike_edwards@uk.ibm.com
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]