0

I have a database like so

<rest:databases xmlns:rest="http://basex.org/rest" 
                name="xml" 
                resources="1">
  <rest:resource type="xml" 
                 content-type="application/xml" 
                 size="33739"
    >path/test.xml</rest:resource>
</rest:databases>

Queries like /rest/xml?query=//element work

But

Queries like /rest/xml/path?query=//element do not

Nor do queries like /rest/xml/path/test.xml?query=//element

Both return an error:

[BXDB0005] Query must yield database nodes.

What am I misunderstanding about the architecture?

C. M. Sperberg-McQueen
  • 24,596
  • 5
  • 38
  • 65
Vigrond
  • 8,148
  • 4
  • 28
  • 46

1 Answers1

0

The most obvious cause of a problem here is that your sample queries

/rest/xml/path?query=//element

and

/rest/xml/path/test.xml?query=//element

append the string '/path' to the database name; what is it doing there? You have shown us you have one document in the database 'xml', named 'test.xml'. You don't show us any documents name 'path'. I'd try

/rest/xml/text.xml?query=//element
C. M. Sperberg-McQueen
  • 24,596
  • 5
  • 38
  • 65