I just started using eXist and tried to insert data into an xml file. So far, I did this in .xql file:
declare function app:save($node as node(), $model as map(*), $name as xs
:string?, $author as xs :string?, $isbn as xs :integer?, $date as xs :integer?) {
for $books in doc("/db/apps/tutorial/library.xml")//LIBRARY/books
return
update insert
<name>$name</name>
<author>$author</author>
<isbn>$isbn</isbn>
<date>$date</date>
into $books
};
and the hierarchy in my xml file file simply looks like this:
<?xml version="1.0"?>
<LIBRARY>
<books>
</books>
<magazines>
</magazines>
<audio>
</audio>
<video>
</video>
</LIBRARY>
I simply need to insert the metadata(which comes from html) about a book but exide gives me "unexpected token: >". It might be a simple question but I got stuck. Your contribution will be highly appreciated.
No comments:
Post a Comment