Hello!
I wonder why I get a syntax error in BaseX for the following code. Is it really not possible to specify this fine granularity for function input types?
<code> declare variable $local:ns := "somenamespace declare function local:afunction( $input as element( QName( $local:ns, "elementname" ) ) ) {
<function-body />
}; </code>
I get error XPST0003 Expecting ')' found '('.
Best regards Kristian Kankainen
Hi Kristian,
I wonder why I get a syntax error in BaseX for the following code. Is it really not possible to specify this fine granularity for function input types?
BaseX behaves correctly. This is what you can do instead:
declare namespace ns = "somenamespace"; declare function local:afunction( $input as element(ns:elementname) ) { ... };
...or...
declare function local:afunction( $input as element(Q{somenamespace}elementname) ) { ... };
If you are interested to know why the spec does not support your query, the best place to ask is probably the talk@x-query.com mailing list [1].
Hope this helps, Christian
[1] http://x-query.com/mailman/listinfo/talk
<code> declare variable $local:ns := "somenamespace declare function local:afunction( $input as element( QName( $local:ns, "elementname" ) ) ) {
<function-body />
};
</code>
I get error XPST0003 Expecting ')' found '('.
Best regards Kristian Kankainen
basex-talk@mailman.uni-konstanz.de