Flat XML fods database

Friday, 14 February 2020 · 5 messages
T
thufir14 Feb 2020 09:15 #
Hi all, I've loaded a .fods file from Libre Office into BaseX and am looking to identify bold cells. This is totally off-topic to BaseX itself, but does anyone have experience in working with .fods files? thanks, Thufir
T
thufir14 Feb 2020 10:27 #
I think I mainly need to add a namespace for fods: thufir@dur:~/fods/flwor$ thufir@dur:~/fods/flwor$ basex text.xq Stopped at /home/thufir/fods/flwor/text.xq, 3/14: [XPST0081] No namespace declared for 'text:p'. thufir@dur:~/fods/flwor$ thufir@dur:~/fods/flwor$ cat text.xq
for $foo  in db:open("foo")
return $foo//text:p
thufir@dur:~/fods/flwor$ https://stackoverflow.com/q/60222478/262852 how do I know all the namespacess? from the libre office file?
MS
Michael Seiferle14 Feb 2020 13:29 #
Hi Thufir, I think you might look up the namespaces from the Libre Office File like so:
Quoted text · thufir · 9 lines
> ( > for $node in $doc//(@*,*) > let $nn := node-name($node) > let $ns-uri := namespace-uri-from-QName($nn) > let $prefix := prefix-from-QName($nn) > where $ns-uri > return ``[declare namespace `{ $prefix }` = "`{ $ns-uri }`"]`` > ) => distinct-values() > => string-join(out:nl())
https://git.basex.io/snippets/77 <https://git.basex.io/snippets/77> Other than that you might have to consult the Schema files I guess :)
Quoted text · thufir · 23 lines
> Am 14.02.2020 um 09:27 schrieb thufir <hawat.thufir at gmail.com>: > > I think I mainly need to add a namespace for fods: > > > thufir@dur:~/fods/flwor$ > thufir@dur:~/fods/flwor$ basex text.xq > Stopped at /home/thufir/fods/flwor/text.xq, 3/14: > [XPST0081] No namespace declared for 'text:p'. > thufir@dur:~/fods/flwor$ > thufir@dur:~/fods/flwor$ cat text.xq > > for $foo in db:open("foo") > return $foo//text:p > > thufir@dur:~/fods/flwor$ > > > https://stackoverflow.com/q/60222478/262852 > > > > how do I know all the namespacess? from the libre office file?
BD
Bridger Dyson-Smith14 Feb 2020 15:06 #
Hi Thufir, You might find Priscilla Walmsley's Functx library[1] section on namespaces helpful (or something else interesting in the functions listed there). Michael - that's a very nice FLOWR! Thank you for sharing. Best, Bridger [1] http://www.xqueryfunctions.com/xq/c0021.html
Quoted text · Michael Seiferle · 48 lines
On Fri, Feb 14, 2020, 7:29 AM Michael Seiferle <ms at basex.org> wrote: > Hi Thufir, > > I think you might look up the namespaces from the Libre Office File like > so: > > ( > for $node in $doc//(@*,*) > let $nn := node-name($node) > let $ns-uri := namespace-uri-from-QName($nn) > let $prefix := prefix-from-QName($nn) > where $ns-uri > return ``[declare namespace `{ $prefix }` = "`{ $ns-uri }`"]`` > ) => distinct-values() > => string-join(out:nl()) > > https://git.basex.io/snippets/77 > > > Other than that you might have to consult the Schema files I guess :) > > > Am 14.02.2020 um 09:27 schrieb thufir <hawat.thufir at gmail.com>: > > I think I mainly need to add a namespace for fods: > > > thufir@dur:~/fods/flwor$ > thufir@dur:~/fods/flwor$ basex text.xq > Stopped at /home/thufir/fods/flwor/text.xq, 3/14: > [XPST0081] No namespace declared for 'text:p'. > thufir@dur:~/fods/flwor$ > thufir@dur:~/fods/flwor$ cat text.xq > > for $foo in db:open("foo") > return $foo//text:p > > thufir@dur:~/fods/flwor$ > > > https://stackoverflow.com/q/60222478/262852 > > > > how do I know all the namespacess? from the libre office file? > > >
T
thufir14 Feb 2020 15:41 #
Hi Bridger, thanks, and yes, I have her book -- still reading it. But I'll skip ahead to that section :) -Thufir
Quoted text · Bridger Dyson-Smith · 61 lines
On 2020-02-14 5:05 a.m., Bridger Dyson-Smith wrote: > Hi Thufir, > > You might find Priscilla Walmsley's Functx library[1] section on > namespaces helpful (or something else interesting in the functions > listed there). > > Michael - that's a very nice FLOWR! Thank you for sharing. > > Best, > Bridger > > [1] http://www.xqueryfunctions.com/xq/c0021.html > > On Fri, Feb 14, 2020, 7:29 AM Michael Seiferle <ms at basex.org > <mailto:ms at basex.org>> wrote: > > Hi Thufir, > > I think you might look up the namespaces from the Libre Office File > like so: >> ( >> for $node in $doc//(@*,*) >> let $nn := node-name($node) >> let $ns-uri := namespace-uri-from-QName($nn) >> let $prefix := prefix-from-QName($nn) >> where $ns-uri >> return ``[declare namespace `{ $prefix }` = "`{ $ns-uri }`"]`` >> ) => distinct-values() >> => string-join(out:nl()) > https://git.basex.io/snippets/77 > > > Other than that you might have to consult the Schema files I guess :) > > >> Am 14.02.2020 um 09:27 schrieb thufir <hawat.thufir at gmail.com >> <mailto:hawat.thufir at gmail.com>>: >> >> I think I mainly need to add a namespace for fods: >> >> >> thufir@dur:~/fods/flwor$ >> thufir@dur:~/fods/flwor$ basex text.xq >> Stopped at /home/thufir/fods/flwor/text.xq, 3/14: >> [XPST0081] No namespace declared for 'text:p'. >> thufir@dur:~/fods/flwor$ >> thufir@dur:~/fods/flwor$ cat text.xq >> >> for $foo in db:open("foo") >> return $foo//text:p >> >> thufir@dur:~/fods/flwor$ >> >> >> https://stackoverflow.com/q/60222478/262852 >> >> >> >> how do I know all the namespacess? from the libre office file? >

⚡Generated with XQuery