[xquery-talk] Fwd: Question

David Carlisle davidc at nag.co.uk
Tue Feb 21 11:22:18 PST 2006

> I dont want the null values for bookstre/book and bookstore/book/author

the values are not null, they are the newlines and white space in the
source file used to indent the input. You can filter the white space
nodes by adding [normalize-space()] as below. Also your value-attribute
contains white space at each end coming from teh indentation, so I've
added normalize-space there as well,.


let $j:= doc("book_sample.xml")
for $path in
let $leafs :=
eq $path]
  <attr-per-path path='{$path}'>{
    for $val in distinct-values($leafs)  
    return <value-per-path value='{normalize-space($val)}'
count='{count($leafs[. eq

This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

More information about the talk mailing list