basex retrieve command
Friday, 13 December 2013 · 2 messages
KR
Kamineni, Rajeshwar13 Dec 2013 04:37 #
Hi
I have a document added using the ADD command. How do I just view it without an XQUERY.
I thought RETRIEVE command should work but doesn’t help.
Are there any other ways??
Thanks
Raj Kamineni
[T] +1 571 434 5463 [M] +1 703 342 9358
AA
Andria Arisal13 Dec 2013 07:06 #
Hi,
'retrieve' command works to retrieve binary resource which is stored in the database (with 'store' command).
if you add a document with 'add' command, you can access that document in your collection with 'position()' function.
eg:
$ ls raw-xml/
new.xml test.xml
$ ls raw-binary/
BaseX_64px.png
$ basex -c "create db test raw-xml/test.xml" <-- create test database with initial document from test.xml
$ basex -c "open test; add raw-xml/new.xml" <-- add new.xml to test database$ basex -c "open test; store raw-binary/BaseX_64px.png" <-- store BaseX_64px.png to test database
$ basex -q "db:open('test')[position() = 2]"
<new/>
$ basex -q "db:open('test')[position() = 1]"
<test/>$ basex -c "open test; retrieve BaseX_64px.png"
�PNG
IDATx^�Z�gAMA��a
...
Hope it helps,
-andria
Quoted text · Rajeshwar · 23 lines
On Fri, Dec 13, 2013 at 4:37 AM, Kamineni, Rajeshwar < rajeshwar.kamineni at neustar.biz> wrote: > Hi > > I have a document added using the ADD command. How do I just view it > without an XQUERY. > > I thought RETRIEVE command should work but doesn’t help. > > Are there any other ways?? > > Thanks > > Raj Kamineni > [T] +1 571 434 5463 [M] +1 703 342 9358 > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
Written for BaseX 7.7. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery