[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Linking Saxon through to exist database

Wolfgang wolfgang at exist-db.org
Sat Jan 24 13:35:49 PST 2009


  Linking Saxon through to exist database
>> You can access documents via HTTP using e.g.
>>
>> http://localhost:8080/exist/rest/db/test/a/books.xml
> 
> wget on http://localhost:8080/exist/rest/db/books/a works fine here.

Ok, but since books/a is a collection, you should get a collection listing:

<exist:collection name="/db/test/a" 
created="2009-01-24T13:29:17.92+01:00" owner="admin" group="dba" 
permissions="rwur-ur-u">
         <exist:resource name="books.xml" 
created="2009-01-24T13:29:17.965+01:00" 
last-modified="2009-01-24T13:29:17.965+01:00" owner="admin" group="dba" 
permissions="rwur-ur-u"/>
</exist:collection>

> Error
>   XPTY0019: Required item type of first operand of '/' is node();
> supplied value has item
>   type xs:string
> Static error(s) in query

You forgot to actually load the document using doc():

let $a := 'http://localhost:8080/exist/rest/db/test/a/books.xml'
return
<books>{
for $book in doc($a)//book
   return
   $book
}</books>

Wolfgang


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.