XQuery
-
I get an error
XQuery Execution Error! Unexpected token - "($email, '[A-Z0-9._%+-]+@"
in the following script
xquery version "1.0";
declare function local:valid-email($email as xs:string)
as xs:boolean
{
return matches($email, '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}')
};Why does it occur? Thanks --
Greetings - Jacek
-
I get an error
XQuery Execution Error! Unexpected token - "($email, '[A-Z0-9._%+-]+@"
in the following script
xquery version "1.0";
declare function local:valid-email($email as xs:string)
as xs:boolean
{
return matches($email, '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}')
};Why does it occur? Thanks --
Greetings - Jacek
Doesn't the 'matches' function need a namespace prefix?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p MVP for 2010 - who'd'a thunk it!
-
I get an error
XQuery Execution Error! Unexpected token - "($email, '[A-Z0-9._%+-]+@"
in the following script
xquery version "1.0";
declare function local:valid-email($email as xs:string)
as xs:boolean
{
return matches($email, '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}')
};Why does it occur? Thanks --
Greetings - Jacek
I have been programming in C too long. There is no "return" instruction in XQuery which means "return". It is a part of from(...) statement exclusively. Solution:
xquery version "1.0";
declare function local:valid-email($email as xs:string)
as xs:boolean
{
matches($email, '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}')
};Sorry for not posting the solution earlier.
Greetings - Jacek
-
Doesn't the 'matches' function need a namespace prefix?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p MVP for 2010 - who'd'a thunk it!