- From: Gary Hallmark <gary.hallmark@oracle.com>
- Date: Thu, 21 Oct 2010 15:25:36 -0700
- To: Christian De Sainte Marie <csma@fr.ibm.com>
- CC: public-rif-wg@w3.org, sandro@w3.org
- Message-ID: <4CC0BDE0.5040004@oracle.com>
the following suggests that the slot name may only be a literal string: 1. For all the [nodes]^XDM /e ? E/, /*I*/_truth (/I/_frame (/I/_DM (/e/))(/I/_C ("/expr/"^^xs:string), /RIFValue(e, expr)/)) = *t* (true) for any well-formed XPath expression,/expr/, for which /RIFValue(e, expr)/ is defined; Another problem with using strings for xpaths is that any typo in the xpath is still a string, and is therefore syntactically valid, but will give unexpected results. Therefore I suggest again that we use a new symbol space, e.g. rif:xpath, rather than overloading xs:string. On 10/21/2010 2:47 PM, Christian De Sainte Marie wrote: > > Hi Gary, > > "Gary Hallmark" <gary.hallmark@oracle.com> wrote on 21/10/2010 16:22:46: > > > > Another issue with encoding xpaths in strings is that it invites > > usage like ?x[fn:concat("eg:" "name")->"Gary"]. This seems forbidden > > by the semantics, but in a rather cryptic way. > > I did not think of that kind of use, but the semantics does not forbid it. > > And I do not think that it should, either. Of course, doing something like that would probably be bad practice in most cases, but I can imagine cases (e.g. involving manipulating XML documents) where this is what you want, and need, to do. > > For instance (trying to make up an example), you process XML data in a stream, and you have a rule that says: if an element has a child element with name "Name", in any namespace, whose content is a list, then insert an <my:NameCorrespondance> element in the stream, blablabla: > > For all ?x ?pre ?elt ?l ?n( > If And(?x[fn:concat(?pre ":" "Name")-> ?l] > fn:is-list(?l))) > Then Do((?nc New()) > Assert(?nc["my:fullname"->?l]) > Assert(?nc["my:firstname"->fn:string(fn:get(?l 0))]) > Assert(?nc["my:lastname"->fn:string(fn:get(?l fn:numeric-substract(fn:count(?l) 1)))]) > Assert(?nc#"/my:NameCorrespondance") > act:Print(fn:concat("<my:NameCorrespondance><my:fullname>" fn:string(?l) "</my:fullname><my:firstname>" ...)))) > > Cheers, > > Christian > > Sauf indication contraire ci-dessus:/ Unless stated otherwise above: > Compagnie IBM France > Siege Social : 17 avenue de l'Europe, 92275 Bois-Colombes Cedex > RCS Nanterre 552 118 465 > Forme Sociale : S.A.S. > Capital Social : 612.509.964 EUR > SIREN/SIRET : 552 118 465 03644 >
Received on Thursday, 21 October 2010 22:27:14 UTC