Prefix declaration for extension functions

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

Prefix declaration for extension functions

mangvlad
I am trying to use exf:sorf function.
My instance has a namespace, which is declared on the top of the page.

I am getting this error when I try to use sort:

"XPath syntax error at char 13 in {t:person-name/t:last-name}:Prefix t has not been declared"

(Example:
...
<xhtml xmlns:t="testNs:test"...>

<xforms:model>
<xforms:instance id="main">
<entities xmlns="testNs:test">
 <entity>
  <person-name>
        <first-name>John</first-name>
        <last-name>Smith</last-name>
  </person-name>
 <gender>M</gender>
</entity>
...
</entities>
</xforms:instance>
</xforms:model>
...
<xforms:repeat nodeset="exf:sort(t:entity, 't:person-name/t:last-name', 'text')> 
...
)

If/when I remove namespace, sort works.
Is there a way to "pass" namespaces into extension functions?

Thanks.




Reply | Threaded
Open this post in threaded view
|

Re: Prefix declaration for extension functions

Alessandro Vernet
Administrator
On Fri, Mar 21, 2008 at 10:33 AM, mangvlad <[hidden email]> wrote:
>  I am trying to use exf:sorf function.
>  My instance has a namespace, which is declared on the top of the page.
>
>  I am getting this error when I try to use sort:
>
>  "XPath syntax error at char 13 in {t:person-name/t:last-name}:Prefix t has
>  not been declared"

And I assume that you have this "t" prefix declared; right? Would you
be able to create an example that runs in the sandbox and that shows
the issue you are describing?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Prefix declaration for extension functions

mangvlad
Alex,

I have "t" prefix declared on the top of my page.
Attached is an example that shows this issue.
(I hope you will just tell me that I am just overlooking a simple syntax error. :) )

Thanks,
Vlad

testSimple.xhtml

Alessandro Vernet wrote
On Fri, Mar 21, 2008 at 10:33 AM, mangvlad <mangvlad@gmail.com> wrote:
>  I am trying to use exf:sorf function.
>  My instance has a namespace, which is declared on the top of the page.
>
>  I am getting this error when I try to use sort:
>
>  "XPath syntax error at char 13 in {t:person-name/t:last-name}:Prefix t has
>  not been declared"

And I assume that you have this "t" prefix declared; right? Would you
be able to create an example that runs in the sandbox and that shows
the issue you are describing?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws


-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/
Reply | Threaded
Open this post in threaded view
|

Re: Re: Prefix declaration for extension functions

Alessandro Vernet
Administrator
Hi Vlad,

On Fri, Mar 21, 2008 at 1:01 PM, mangvlad <[hidden email]> wrote:
>  I have "t" prefix declared on the top of my page.
>  Attached is an example that shows this issue.
>  (I hope you will just tell me that I am just overlooking a simple syntax
>  error. :) )

I see. Thank you for the test case that runs in the XForms sandbox.
The problem is with the XPath expression passed as a string to
exf:sort(). I have created a bug to track this (linked below), and for
now you can write the expression as:

exf:sort(t:entity, '*:person-name/*:first-name', 'text')

http://forge.objectweb.org/tracker/index.php?func=detail&aid=308936&group_id=168&atid=350207

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Prefix declaration for extension functions

mangvlad
Alex,

Thank you very much for very quick reply and very clever work-around.

(As a plus, I guess, it was not one of the instances of me making a stupid mistake... :)
On the other hand, I should of figured out the work around without bugging anyone, sorry. :( )

I am also wondering if this is just limited to the sort() function or applies to other XPath extensions as well...

Thanks again!

Vlad


Alessandro Vernet wrote
Hi Vlad,

On Fri, Mar 21, 2008 at 1:01 PM, mangvlad <mangvlad@gmail.com> wrote:
>  I have "t" prefix declared on the top of my page.
>  Attached is an example that shows this issue.
>  (I hope you will just tell me that I am just overlooking a simple syntax
>  error. :) )

I see. Thank you for the test case that runs in the XForms sandbox.
The problem is with the XPath expression passed as a string to
exf:sort(). I have created a bug to track this (linked below), and for
now you can write the expression as:

exf:sort(t:entity, '*:person-name/*:first-name', 'text')

http://forge.objectweb.org/tracker/index.php?func=detail&aid=308936&group_id=168&atid=350207

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws


-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Prefix declaration for extension functions

Alessandro Vernet
Administrator
Vlad,

On Fri, Mar 21, 2008 at 7:35 PM, mangvlad <[hidden email]> wrote:
>  I am also wondering if this is just limited to the sort() function or
>  applies to other XPath extensions as well...

This could happen in other cases where an XPath expression is passed
as a string to the a function. This is not very frequent though. One
such function that I use quite frequently is saxon:evaluate(). I just
checked that this one works correctly, so I think we are mostly good,
but of course if you find any other case where this happen please let
us know.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Prefix declaration for extension functions

Erik Bruchez
Administrator
This bug is now fixed.

-Erik

On Mar 21, 2008, at 7:53 PM, Alessandro Vernet wrote:

> Vlad,
>
> On Fri, Mar 21, 2008 at 7:35 PM, mangvlad <[hidden email]> wrote:
>> I am also wondering if this is just limited to the sort() function or
>> applies to other XPath extensions as well...
>
> This could happen in other cases where an XPath expression is passed
> as a string to the a function. This is not very frequent though. One
> such function that I use quite frequently is saxon:evaluate(). I just
> checked that this one works correctly, so I think we are mostly good,
> but of course if you find any other case where this happen please let
> us know.
>
> Alex
> --  
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.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
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.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
OW2 mailing lists service home page: http://www.ow2.org/wws