qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] nested document error using xquery - my solution


From: heiko
Subject: Re: [Qexo-general] nested document error using xquery - my solution
Date: Tue, 01 Apr 2003 00:51:17 -0800 (PST)

Hi all,

i found the error on my own.
still the reason why this works, or what i configured
wrong is still unclear for me.

calling the "xxxx.xml" wasn't enough. i had also
declare the "url" to the filename as full path

so here is the script where i call a document (xml)
depending on the request url.

define function path-Of-Request ($field) {
   invoke($request,$field)
}
define function create-filename () {
     let $path := path-Of-Request("getRequestURI"),
         $filename-start := substring($path, 2, 7),
         $url-name := "http://localhost:8080/";,
         $prefix-path := concat ($url-name, $filename-start),
         $filename := concat($prefix-path, ".xml")
     return $filename
}
define function make-table ($filename)  {
        <html>
        {
            let $newline := "
                "
                let $book := document($filename)/book
                for $ch in $book/chapter
                for $ti in $ch/title return
(<h2>{children($ti)}</h2>, $newline)
        }
        </html>
}
let $filename := create-filename()
return (make-table($filename))

kind regards 

Heiko




reply via email to

[Prev in Thread] Current Thread [Next in Thread]