[xquery-talk]extracting document sections

Wolfgang Meier wolfgang at exist-db.org
Wed Apr 19 14:33:52 PDT 2006


> Now I am trying to extract each of those <Para></Para> into individual
> documents and store it in the DB.

That should be easy, but you need to use an extension function to
store the data back into the db. Try the following query:

import module namespace xdb="http://exist-db.org/xquery/xmldb";

for $p at $pos in //Para
return
    xdb:store("/db/content", concat("para", $pos, ".xml"), $p, "text/xml")

The new files will be named para1.xml, para2.xml ...

Wolfgang



More information about the talk mailing list