[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [sca-assembly] What is the form of an @source XPath expressionwhere the source property is multi-valued?
Hi Mike, Since I just spent some time yesterday looking at XPath questions unrelated to SCA, I figured I'd look at Mike's question. Along the way, I felt like I started digging a ditch, and nobody was taking the shovel away from me. First, a typo: Assembly spec CD05 (PDF), line 1727: <property name="currency" source="$complexFoo/a"/> ... but this should be: <property name="currency" source="$complexFoo/foo:a"/> It appears that the current form has confused the target namespace of the document with the prefixes in-scope where the XPath expression occurs. The text following the example should probably be corrected to match. I also noticed that, although XPath is referenced five times in the spec, and appears to guide normative behavior, there's no normative reference to XPath that would even indicate which *version* of XPath is intended. Looking through your discussion, and the text of the spec, it does look like we could use a proper formal definition for what it means to define and then evaluate a property. Not being super familiar with the properties, I'm hesitant to take a full run at the proper text, so here's an attempt that I expect needs much modification. The @name attribute of a property defines a an XPath variable in scope for the composite document. The value of the XPath variable is zero or more element nodes. When a default property value is specified, and not overridden, the value of the XPath variable is defined with the XPath expression "*", where the current node is the property definition. In the case of a "@file" reference for a property value, this is definitely unclear, and I have no idea what is intended here. Is the root element of the document supposed to match the "@type" or "@element" of the property? What if the property is multi-value? Do we really only want to reference root elements, or do we intend for an XPath into the referenced document? Maybe there's text in the spec about this, but due to my lack of familiarity in this area, I've missed it. ASM 50029 is utterly confusing to me. A small wording change might be appropriate. I think I know what is intended, but I'm not certain. Line 4629 - definition of the SCA "value" element seems like it would be invalid. If a property uses the "@type" form of reference, then the "value" sub-element must be of the type specified by @type. This schema declaration obscures the fact that the type of "value" is actually different than what it is declared to be, as it validates any content underneath it. Perhaps we should be encouraging the use of xsi:type in conjunction with the use of @type form - so validation can be done correctly? And then we should drop the declaration of the "value" element. Actually, considering further, if we want to keep the "value" element, I think the right thing to do is define it as an abstract element derived from xsd:anyType. We're truly into the obscure corners of XML Schema here. I'm hesitant to immediately file formal issues here, because I'm not very familiar with properties, but I agree with Mike that what is currently there leaves plenty of room for confusion. -Eric. P.S. Random note: Snippet 8-1 - uses the "sca:" prefix without declaring it. On 07/21/2010 02:56 AM, Mike Edwards wrote: OF8136E9A3.E18AD6C0-ON80257767.00349666-80257767.00368ADD@uk.ibm.com" type="cite"> |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]