[Monetdb-developers] Unimplemented XQuery standard functions
Dear all,
For demo purposes we are in need for implementations of some XQuery standard functions, especially fn:tokenize() and fn:base-uri().
Are there plans for implementing more (or all) standard functions?
Best, Djoerd.
Hi Djoerd,
I desperately needed tokenize() myself, so I wrote my own version in XQuery. Incredably slow, but it works. Note that $sep should be a string with only one character.
declare function pxml:poormansTokenize($s as xs:string, $sep as xs:string) { let $slen := string-length($s) ,$split := for $i in (1 to $slen) return substring($s,$i,1) ,$pos := (0,(for $c at $p in $split where $c eq $sep return $p),$slen+1) ,$len := for $i in (2 to count($pos)) return exactly-one($pos[$i]) - exactly-one($pos[$i - 1]) - 1 for $p at $i in $len return substring($s,exactly-one($pos[$i])+1,$p) };
Hope this helps.
Kind regards, Maurice.
Djoerd Hiemstra wrote:
Dear all,
For demo purposes we are in need for implementations of some XQuery standard functions, especially fn:tokenize() and fn:base-uri().
Are there plans for implementing more (or all) standard functions?
Best, Djoerd.
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
participants (2)
-
Djoerd Hiemstra
-
Maurice van Keulen