Xpath 2.0 evaluation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Xpath 2.0 evaluation

Marc.Benimeli
Hi all,

I'm trying to build a Xpath 2.0 expression in an xforms:output element.

So here is my expression :

        <xforms:output value="if (true()) then concat('&lt;a','
href=&#34;javascript:MyFunction(&#
39;<a href="http://MyServer/MyFile&#39;)&#34;','&gt;'">http://MyServer/MyFile&#39;)&#34;','&gt;') else ''"
mediatype="text/html"/>

I want to build :

        <a href="javascript:MyFunction('http://MyServer/MyFile')>

I have the following error message :

        ! XForms error: XPath syntax error at char 71 in
{...f="javascript:MyFunction('http...}: expected ")", found name
"http:"

Can anyone tell me what am I doing wrong ?

Marc



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Xpath 2.0 evaluation

alhaziz
Perhaps is taking ':' character as comment inside
XPATH, I have experienced this while trying to call a
javascript function using XPath...

Try to replace it with something like "&lt;" which is
a legal replacement of '<' char.

  Regards, Al.Haziz.

--- [hidden email] wrote:

> Hi all,
>
> I'm trying to build a Xpath 2.0 expression in an
> xforms:output element.
>
> So here is my expression :
>
> <xforms:output value="if (true()) then
> concat('&lt;a','
> href="javascript:MyFunction(&#65533;
> 39;http://MyServer/MyFile')"','&gt;') else
> ''"
> mediatype="text/html"/>
>
> I want to build :
>
> <a
>
href="javascript:MyFunction('http://MyServer/MyFile')>

>
> I have the following error message :
>
> ! XForms error: XPath syntax error at char 71 in
> {...f="javascript:MyFunction('http...}: expected
> ")", found name
> "http:"
>
> Can anyone tell me what am I doing wrong ?
>
> Marc
>
> >
> --
> You receive this message as a subscriber of the
> [hidden email] mailing list.
> To unsubscribe:
> mailto:[hidden email]
> For general help:
> mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page:
> http://www.objectweb.org/wws
>

Send instant messages to your online friends http://uk.messenger.yahoo.com 



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Xpath 2.0 evaluation

Marc.Benimeli
In reply to this post by Marc.Benimeli
Hi al,

Replacing : with &#58; is not solving the problem.

Thanks for your help

Marc

-----Message d'origine-----
De : al haziz [mailto:[hidden email]]
Envoyé : vendredi 24 mars 2006 20:06
À : [hidden email]
Objet : Re: [ops-users] Xpath 2.0 evaluation

Perhaps is taking ':' character as comment inside XPATH, I have experienced this while trying to call a javascript function using XPath...

Try to replace it with something like "&lt;" which is a legal replacement of '<' char.

  Regards, Al.Haziz.

--- [hidden email] wrote:

> Hi all,
>
> I'm trying to build a Xpath 2.0 expression in an xforms:output
> element.
>
> So here is my expression :
>
> <xforms:output value="if (true()) then concat('&lt;a','
> href="javascript:MyFunction(&#65533;
> 39;http://MyServer/MyFile')"','&gt;') else ''"
> mediatype="text/html"/>
>
> I want to build :
>
> <a
>
href="javascript:MyFunction('http://MyServer/MyFile')>

>
> I have the following error message :
>
> ! XForms error: XPath syntax error at char 71 in
> {...f="javascript:MyFunction('http...}: expected ")", found name
> "http:"
>
> Can anyone tell me what am I doing wrong ?
>
> Marc
>
> >
> --
> You receive this message as a subscriber of the
> [hidden email] mailing list.
> To unsubscribe:
> mailto:[hidden email]
> For general help:
> mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page:
> http://www.objectweb.org/wws
>

Send instant messages to your online friends http://uk.messenger.yahoo.com 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Xpath 2.0 evaluation

Ryan Puddephatt
Marc,
        The : is not the problem it’s the quotes (") you need to replace
them with &quot;

Ryan Puddephatt
Software Engineer
TFX Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

>-----Original Message-----
>From: [hidden email] [mailto:[hidden email]]
>Sent: 27 March 2006 13:45
>To: [hidden email]
>Subject: RE: [ops-users] Xpath 2.0 evaluation
>
>Hi al,
>
>Replacing : with &#58; is not solving the problem.
>
>Thanks for your help
>
>Marc
>
>-----Message d'origine-----
>De : al haziz [mailto:[hidden email]]
>Envoyé : vendredi 24 mars 2006 20:06
>À : [hidden email]
>Objet : Re: [ops-users] Xpath 2.0 evaluation
>
>Perhaps is taking ':' character as comment inside XPATH, I have experienced
>this while trying to call a javascript function using XPath...
>
>Try to replace it with something like "&lt;" which is a legal replacement
>of '<' char.
>
>  Regards, Al.Haziz.
>
>--- [hidden email] wrote:
>
>> Hi all,
>>
>> I'm trying to build a Xpath 2.0 expression in an xforms:output
>> element.
>>
>> So here is my expression :
>>
>> <xforms:output value="if (true()) then concat('&lt;a','
>> href="javascript:MyFunction(&#65533;
>> 39;http://MyServer/MyFile')"','&gt;') else ''"
>> mediatype="text/html"/>
>>
>> I want to build :
>>
>> <a
>>
>href="javascript:MyFunction('http://MyServer/MyFile')>
>>
>> I have the following error message :
>>
>> ! XForms error: XPath syntax error at char 71 in
>> {...f="javascript:MyFunction('http...}: expected ")", found name
>> "http:"
>>
>> Can anyone tell me what am I doing wrong ?
>>
>> Marc
>>
>> >
>> --
>> You receive this message as a subscriber of the
>> [hidden email] mailing list.
>> To unsubscribe:
>> mailto:[hidden email]
>> For general help:
>> mailto:[hidden email]?subject=help
>> ObjectWeb mailing lists service home page:
>> http://www.objectweb.org/wws
>>
>
>
>Send instant messages to your online friends http://uk.messenger.yahoo.com
>




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Xpath 2.0 evaluation

Erik Bruchez
Administrator
In reply to this post by Marc.Benimeli
Marc,

To escape a single quote in an XPath 2.0 expression, use two single
quotes ('', not "). Note that funnily enough, this is not possible in
XPath 1.0. Using &quot; doesn't help, as that is interpreted by the
parser, not by the XPath interpreter.

-Erik

[hidden email] wrote:

> Hi all,
>
> I'm trying to build a Xpath 2.0 expression in an xforms:output element.
>
> So here is my expression :
>
> <xforms:output value="if (true()) then concat('&lt;a','
> href=&#34;javascript:MyFunction(&#
> 39;<a href="http://MyServer/MyFile&#39;)&#34;','&gt;'">http://MyServer/MyFile&#39;)&#34;','&gt;') else ''"
> mediatype="text/html"/>
>
> I want to build :
>
> <a href="javascript:MyFunction('http://MyServer/MyFile')>
>
> I have the following error message :
>
> ! XForms error: XPath syntax error at char 71 in
> {...f="javascript:MyFunction('http...}: expected ")", found name
> "http:"
>
> Can anyone tell me what am I doing wrong ?
>
> Marc



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws