Shoud 'addraw' work as parameter with db:create?
Friday, 24 January 2020 · 3 messages · last reply 25 Jan 2020
FB
France Baril24 Jan 2020 15:11 #
Hi,
I have this function that loads all the indexable content, but leaves the .png behind. Am I missing something?
declare %rest:path("/demo/create-db")
%rest:GET
%rest:query-param('db', '{$db}', 'new-name')
%rest:query-param('dir-src', '{$dir-src}', '')
%output:method("html")
%output:html-version("5.0")
updating function democlean:create-db($db as xs:string, $dir-src as
xs:string){
let $params := map {'updindex': true(), 'language': 'fr', 'addraw':
true(), 'chop': false(), 'intparse': true(), 'createfilter': '*.xml,
*.ditamap, *.dita'}
return (
if (db:exists($db))
then db:drop($db)
else (),
if ($dir-src = '')
then
db:create($db, (), (), $params)
else
db:create($db, $dir-src, '/', $params),
db:output(<div>DB ready</div>)
)
} I also tried 'serializer: ''indent=no' as a parameter, which was unrecognized. I assume that since addraw is not unrecognized, it should work.
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
CG
Christian Grün24 Jan 2020 18:42 #
Hi France,
I just ran a little 'test.bxs' command script with the following contents on command line:
xquery file:create-dir('test')
xquery file:write('test/dummy.png', ())
xquery db:create('db', 'test', '/', map { 'addraw': true() })
xquery db:list('db')It outputs 'dummy.png' as expected.
Could you provide us with some self-contained example code?
Thanks,
Christian
Quoted text · France Baril · 35 lines
On Fri, Jan 24, 2020 at 3:12 PM France Baril <france.baril at architextus.com> wrote: > > Hi, > > I have this function that loads all the indexable content, but leaves the .png behind. Am I missing something? > > declare %rest:path("/demo/create-db") > %rest:GET > %rest:query-param('db', '{$db}', 'new-name') > %rest:query-param('dir-src', '{$dir-src}', '') > %output:method("html") > %output:html-version("5.0") > updating function democlean:create-db($db as xs:string, $dir-src as xs:string){ > let $params := map {'updindex': true(), 'language': 'fr', 'addraw': true(), 'chop': false(), 'intparse': true(), 'createfilter': '*.xml, *.ditamap, *.dita'} > return ( > if (db:exists($db)) > then db:drop($db) > else (), > if ($dir-src = '') > then > db:create($db, (), (), $params) > else > db:create($db, $dir-src, '/', $params), > > db:output(<div>DB ready</div>) > ) > } > > I also tried 'serializer: ''indent=no' as a parameter, which was unrecognized. I assume that since addraw is not unrecognized, it should work. > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com
FB
France Baril25 Jan 2020 12:12 #
After running a few more tests I see that it works in 9-3-1 but not in 8-6-2.
I guess that calls for a migration.
Quoted text · Christian Grün · 63 lines
On Fri, Jan 24, 2020 at 5:42 PM Christian Grün <christian.gruen at gmail.com> wrote: > Hi France, > > I just ran a little 'test.bxs' command script with the following > contents on command line: > > xquery file:create-dir('test') > xquery file:write('test/dummy.png', ()) > xquery db:create('db', 'test', '/', map { 'addraw': true() }) > xquery db:list('db') > > It outputs 'dummy.png' as expected. > > Could you provide us with some self-contained example code? > > Thanks, > Christian > > > > On Fri, Jan 24, 2020 at 3:12 PM France Baril > <france.baril at architextus.com> wrote: > > > > Hi, > > > > I have this function that loads all the indexable content, but leaves > the .png behind. Am I missing something? > > > > declare %rest:path("/demo/create-db") > > %rest:GET > > %rest:query-param('db', '{$db}', 'new-name') > > %rest:query-param('dir-src', '{$dir-src}', '') > > %output:method("html") > > %output:html-version("5.0") > > updating function democlean:create-db($db as xs:string, $dir-src as > xs:string){ > > let $params := map {'updindex': true(), 'language': 'fr', 'addraw': > true(), 'chop': false(), 'intparse': true(), 'createfilter': '*.xml, > *.ditamap, *.dita'} > > return ( > > if (db:exists($db)) > > then db:drop($db) > > else (), > > if ($dir-src = '') > > then > > db:create($db, (), (), $params) > > else > > db:create($db, $dir-src, '/', $params), > > > > db:output(<div>DB ready</div>) > > ) > > } > > > > I also tried 'serializer: ''indent=no' as a parameter, which was > unrecognized. I assume that since addraw is not unrecognized, it should > work. > > > > -- > > France Baril > > Architecte documentaire / Documentation architect > > france.baril at architextus.com >
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
Written for BaseX 9.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery