Re: [basex-talk] Add line-number function

2018-07-05 Thread Fabrice ETANCHAUD
As BaseX does not work on the XML textual representation, it might not be 
possible.


De : BaseX-Talk [mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part 
de ? ??
Envoyé : jeudi 5 juillet 2018 17:10
À : basex-talk@mailman.uni-konstanz.de
Objet : [basex-talk] Add line-number function



Hello, could the $err:line-number [1] variable help you ?

[1] http://docs.basex.org/wiki/XQuery_3.0#Try.2FCatch

Best regards,

Fabrice ETANCHAUD
cerfrancepch
No, $err:line-number show line number of xquery file.
I want this:

Example.xml ->
1: 
2:   
3:  text1
4:  text2
5:  text3
6:  text4
7:
8: 

Xquery ->
let $f := doc("example.xml")
let $e := $f/root/child[1]/grandchild[3]

let $line := line-number($e)

And I want get $line = 5 !


[basex-talk] Add line-number function

2018-07-05 Thread Павел Павлов

>
>Hello, could the $err:line-number [1] variable help you ?
>
>[1]  http://docs.basex.org/wiki/XQuery_3.0#Try.2FCatch
>
>Best regards,
>
>Fabrice ETANCHAUD
>cerfrancepch 
No, $err:line-number show line number of xquery file. 
I want this:

Example.xml ->
1: 
2:   
3:      text1
4:      text2
5:      text3
6:      text4
7:    
8: 

Xquery ->
let $f := doc("example.xml")
let $e := $f/root/child[1]/grandchild[3]

let $line := line-number($e)

And I want get $line = 5 !


Re: [basex-talk] Add line-number function

2018-07-05 Thread Fabrice ETANCHAUD
Hello, could the $err:line-number [1] variable help you ?

[1] http://docs.basex.org/wiki/XQuery_3.0#Try.2FCatch

Best regards,

Fabrice ETANCHAUD
cerfrancepch


De : BaseX-Talk [mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part 
de ? ??
Envoyé : jeudi 5 juillet 2018 06:39
À : basex-talk@mailman.uni-konstanz.de
Objet : [basex-talk] Add line-number function

Hello!

Can you add to BaseX (as module) function "line-number" which retrieves the 
line number of the expression ?
Same as in eXist-db 
(http://exist-db.org/exist/apps/fundocs/view.html?uri=http://exist-db.org/xquery/util=java:org.exist.xquery.functions.util.UtilModule=true)
 or saxon 
(http://www.saxonica.com/html/documentation/functions/saxon/line-number.html).

it is very important for us because our users want see error line number in xml 
docs when our xquery scripts validate them.