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 BTW - in terms of 'special characters' I assumed it meant path separators - I guess theres no requirement to have a property name like "this/property"? cheers, Ed. On 09/08/06, Pete Robbins <[EMAIL PROTECTED]> wrote:
Good! because the SDO XPath code looks a bit messy :-( Cheers, On 09/08/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote: > > Jean-Sebastien Delfino wrote: > > Pete Robbins wrote: > >> I'll take a look at the XPath stuff in SDO and see if we can avoid the > >> annotations for the new assembly model schema. It may not be simple > >> so we > >> may have to annotate the schema to start with and fix this later. > >> > >> Cheers, > >> > > > > OK, let me know. If it turns out that we need the annotations to start > > with as a workaround to this issue with dots, then no problem I'll add > > them. Thanks. > > > > Interesting how sometimes expected design issues turn into non-issues > once you actually write code :) I tried to use the XSDs without > annotations, and... everything works! > > This is because the ModelLoader works with the base XSD complex types > and substitution groups, which contain no dots in their names. We never > do DataObject.get("interface.cpp") for example, we only do > DataObject.get("interface")... So there was no problem after all :) we > don't need any annotations in the SCDL XSDs. > > -- > Jean-Sebastien > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Pete