You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by hsp_ <pi...@ibest.com.br> on 2008/02/11 13:26:15 UTC
Xpath search with child axis.
Hi;
Sorry by put a message in jira, without have sure that was a bug....
Well, my problem remains almost the same.
Like you wrote:
"You need to escape the initial digit of the uuid. Digits are not valid
start characters for XML names.
/jcr:root/A/B//element(*,my:type)[X/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number
>= 1]
...
"
I did it (and don't get it), but in the repository I have a node in this
path: _pX/Y/0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2;
when I do the following search there is no result (and there is the value 3
in property @prop:number) :
/jcr:root/A/B//element(*,my:type)[_pX/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number>=1].
Is the path "_pX" invalid eigther in XML???
In other hands, if I do the
search:/jcr:root/A/B//element(*,my:type)[_pX/Y/*/@prop:number>=1];
it returns a result but whatever the value in property @prop:number (long).
So, this way I have in trouble in my use case, both ways to build a
expression has a extrange behavior that I could get your explanation for.
Thanks.
Helio
--
View this message in context: http://www.nabble.com/Xpath-search-with-child-axis.-tp15410569p15410569.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Xpath search with child axis.
Posted by hsp_ <pi...@ibest.com.br>.
OK Marcel, it worked.
I was not converting all the uuid with ISO9075.encode(uuid). I was only
putting the "_x" before the uuid...
Thank you so much!
Marcel Reutegger wrote:
>
> Hi Helio,
>
> I've written a small test, but was unable to reproduce your issue:
>
> public void testQuery() throws RepositoryException {
> Node x = testRootNode.addNode("_pX");
> Node y = x.addNode("Y");
> String uuid;
> while (Character.isLetter(
> (uuid = UUID.randomUUID().toString()).charAt(0))) {
> }
> Node u = y.addNode(uuid);
> u.setProperty("prop", 3);
> testRootNode.save();
> String stmt = "/jcr:root/" + testPath +
> "[_pX/Y/" + ISO9075.encode(uuid) + "/@prop >= 1]";
> System.out.println(stmt);
> executeXPathQuery(stmt, new Node[]{testRootNode});
> }
>
> can you please check again that your query statement is correct?
>
> regards
> marcel
>
> hsp_ wrote:
>> Hi;
>> Sorry by put a message in jira, without have sure that was a bug....
>> Well, my problem remains almost the same.
>> Like you wrote:
>> "You need to escape the initial digit of the uuid. Digits are not valid
>> start characters for XML names.
>> /jcr:root/A/B//element(*,my:type)[X/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number
>>> = 1]
>> ...
>> "
>> I did it (and don't get it), but in the repository I have a node in this
>> path: _pX/Y/0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2;
>> when I do the following search there is no result (and there is the value
>> 3
>> in property @prop:number) :
>> /jcr:root/A/B//element(*,my:type)[_pX/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number>=1].
>>
>> Is the path "_pX" invalid eigther in XML???
>>
>> In other hands, if I do the
>> search:/jcr:root/A/B//element(*,my:type)[_pX/Y/*/@prop:number>=1];
>> it returns a result but whatever the value in property @prop:number
>> (long).
>>
>> So, this way I have in trouble in my use case, both ways to build a
>> expression has a extrange behavior that I could get your explanation for.
>> Thanks.
>> Helio
>
>
>
--
View this message in context: http://www.nabble.com/Xpath-search-with-child-axis.-tp15410569p15466375.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Xpath search with child axis.
Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Helio,
I've written a small test, but was unable to reproduce your issue:
public void testQuery() throws RepositoryException {
Node x = testRootNode.addNode("_pX");
Node y = x.addNode("Y");
String uuid;
while (Character.isLetter(
(uuid = UUID.randomUUID().toString()).charAt(0))) {
}
Node u = y.addNode(uuid);
u.setProperty("prop", 3);
testRootNode.save();
String stmt = "/jcr:root/" + testPath +
"[_pX/Y/" + ISO9075.encode(uuid) + "/@prop >= 1]";
System.out.println(stmt);
executeXPathQuery(stmt, new Node[]{testRootNode});
}
can you please check again that your query statement is correct?
regards
marcel
hsp_ wrote:
> Hi;
> Sorry by put a message in jira, without have sure that was a bug....
> Well, my problem remains almost the same.
> Like you wrote:
> "You need to escape the initial digit of the uuid. Digits are not valid
> start characters for XML names.
> /jcr:root/A/B//element(*,my:type)[X/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number
>> = 1]
> ...
> "
> I did it (and don't get it), but in the repository I have a node in this
> path: _pX/Y/0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2;
> when I do the following search there is no result (and there is the value 3
> in property @prop:number) :
> /jcr:root/A/B//element(*,my:type)[_pX/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number>=1].
>
> Is the path "_pX" invalid eigther in XML???
>
> In other hands, if I do the
> search:/jcr:root/A/B//element(*,my:type)[_pX/Y/*/@prop:number>=1];
> it returns a result but whatever the value in property @prop:number (long).
>
> So, this way I have in trouble in my use case, both ways to build a
> expression has a extrange behavior that I could get your explanation for.
> Thanks.
> Helio
Re: Xpath search with child axis.
Posted by hsp_ <pi...@ibest.com.br>.
Have anyone some behavior like I described?
Is this post so obviously to worth an anwer?
I Would get some help.
If I wasn't clear, request another explanation, no problem.
Tks.
Helio.
hsp_ wrote:
>
> Hi;
> Sorry by put a message in jira, without have sure that was a bug....
> Well, my problem remains almost the same.
> Like you wrote:
> "You need to escape the initial digit of the uuid. Digits are not valid
> start characters for XML names.
> /jcr:root/A/B//element(*,my:type)[X/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number
> >= 1]
> ...
> "
> I did it (and don't get it), but in the repository I have a node in this
> path: _pX/Y/0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2;
> when I do the following search there is no result (and there is the value
> 3 in property @prop:number) :
> /jcr:root/A/B//element(*,my:type)[_pX/Y/_x0033_ca3f395-7ae9-4553-b0d2-401b3bdff3d2/@prop:number>=1].
>
> Is the path "_pX" invalid in XML eigther ???
>
> In other hands, if I do the
> search:/jcr:root/A/B//element(*,my:type)[_pX/Y/*/@prop:number>=1];
> it returns a result but whatever the value in property @prop:number
> (long).
>
> So, this way I have in trouble in my use case, both ways to build a
> expression has a extrange behavior that I would get your explanation for.
> Thanks.
> Helio
>
--
View this message in context: http://www.nabble.com/Xpath-search-with-child-axis.-tp15410569p15441506.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.