HTML parsing in the DBA

Monday, 10 August 2015 · 2 messages · last reply 12 Aug 2015
KK
Kristian Kankainen10 Aug 2015 22:24 #
Hello! I tried simple cut and paste from the wiki and came up with the following query for importing an HTML file. The DBA says "Query was successful", but no resources are never added to the db.
declare option db:parser "html";
declare option db:htmlparser "html=false,nodefaults=true";
db:replace("dbname", "filename.html", "/file/path/filename.html")
I'm running the latest war file on Tomcat. Best wishes Kristian Kankainen
CG
Christian Grün12 Aug 2015 10:57 #
Hi Kristian, Thanks for the hint; the problem is fixed in the latest snapshot [1]. Best, Christian A side note: Global options may eventually be removed. See the alternative writing:
let $options := map { 'html':false(), 'nodefaults':true() }
let $file := "/file/path/filename.html"
return db:replace("dbname", "filename.html",
  html:parse(file:read-text($file), $options)
)

⚡Generated with XQuery