On 11/08/06, Edward Slattery <[EMAIL PROTECTED]> wrote:

Yes, the SDO Xpath support was always one of those 'must rewrite when
theres
time' items.
It doesnt support dots in property names, as it uses the "." or a "[" to
indicate that the property being referenced is a many-valued property and
must be accessed via getList, using the index following the "." or "[".

I guess a better solution would be to take the element of the path between
path separators, and first validate whether the element is an expected
property of the current object. If it is just use it, otherwise see of the
last lump of the element is an index, and try again with the remainder of
the element.

It would be interesting to see what the current java implementation makes
of:

data object type bar
{
property fred - type DataObject.
}

data object  type foo
{
property  "a.property.name" - many  valued data object of type bar
property  "a.property.name.1" -  single valued data object
}

foo->getDataObject("a.property.name.2"); // getting from the array
foo->getDataObject("a.property.name.1"); // getting from the single value
foo->getDataObject("a.property.name.1/fred"); // getting from element 1 of
the array


Fuhwei answered this above and I think it's a reasonable approach (and I
think what you are suggesting):

First, it checks whether "a.property.name.1" is a valid property name. If
yes, getDataObject() would return the value of "a.property.name.1" otherwise
it treats "a.property.name.1" as an XPath string.

Cheers,

--
Pete

Reply via email to