Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying a document collection does not seem to return non-XML files #18

Open
grantcv1 opened this issue Mar 5, 2021 · 2 comments
Open

Comments

@grantcv1
Copy link

grantcv1 commented Mar 5, 2021

I'm running the Alpha 3 Docker instance.

I'm finding that I can't see the PDF files I have installed alongside my XML documents.

This had worked fine with eXist-db and I've changed nothing other that switch to the FusionDB instance.

My simplified xquery is:

xquery version "3.1";
declare namespace d="DAV:";
for $doc in collection('/repository/grantcv1')
  return (
    let $fileURI := base-uri($doc)
    return <d:response xmlns:d="DAV:">
      <d:href>{$fileURI}</d:href>
    </d:response>
  )
 
I get all the XML files, but nothing else. I used to get the complete list of files in the folder.

@joewiz
Copy link

joewiz commented Mar 5, 2021

The behavior you see in eXist was true for eXist 5.2.0 and lower, but with eXist-db/exist#3349, the next release of eXist will match the behavior you see in FusionDB. The change was to ensure fn:collection() function would return proper document-node() nodes (containing XML data, not binary data). As an alternative for your use case, consider xmldb:get-child-resources().

@adamretter
Copy link
Member

Thanks @joewiz. @grantcv1 The change was made so that FusionDB (and eXist-db) become more compliant with the W3C XQuery specifications. There is some explanation and details in the issue that Joe referenced.

For returning a list of URI as your query above is shown, it is actually more efficient to use xmldb:get-child-resources as suggested by Joe.

I hope that helps? Let us know if you need any more support in this area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants