What is the syntax to declare a namespace for Libre Office, and what specific namespace needs to be declared?
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$
Of course, returning $foo
by itself works fine to return the document in its entirety.
Do I need the namespace stored locally in a file, also? Or, just add something like:
declare namespace type4="http:///de/tudarmstadt/ukp/dkpro/core/api/segmentation/type.ecore";
Every namespace prefix you use in your query must be declared in the query, too. In your case you can add a line
declare namespace text="urn:oasis:names:tc:opendocument:xmlns:text:1.0";
at the top to fix your query.
Since the namespace prefixes (text
in your case) are only a reference to the associated namespace URI, it does not have to match the prefix in the XML document. The following query is 100% equivalent:
declare namespace whatever="urn:oasis:names:tc:opendocument:xmlns:text:1.0";
for $foo in db:open("foo")
return $foo//whatever:p