[xquery-talk] xquery with large xml file

fatma helmy fatmahelmy2000 at yahoo.com
Thu Apr 20 00:21:25 PDT 2006


well, i tried the top down approach code but where can
i pass my file name 
let $j:= doc("book_sample.xml")

--- Michael Kay <mhk at mhk.me.uk> wrote:

> > I finally got around to running this against the
> 100Mb data 
> > file with Saxon.
> > It produces the same size output (don't know why
> the 
> > expansion factor should be different on the 10Mb
> file) in 5 
> > minutes 45 seconds. 
> > 
> 
> 
> The equivalent non-recursive query
> 
> //*/string-join(ancestor-or-self::*/local-name(),
> '/')
> 
> (actually a pure XPath expression) takes 2 mins 23
> seconds.
> 
> I also tried a top-down approach, to reduce the
> number of redundant string
> concatenations and calls on local-name():
> 
> declare function local:pathOfNodes($parentPath as
> xs:string, $node as
> node()) as xs:string* {
>     let $this := concat($parentPath, '/',
> local-name($node)) 
>     return ($this, $node/*/local:pathOfNodes($this,
> .))
> }; 
>     
> local:pathOfNodes('', /*)
> 
> This took 3m 29s.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the talk mailing list