Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:37:17+00:00 2026-06-12T09:37:17+00:00

I want to query the eXist db via the XQJ API. Therefore I have

  • 0

I want to query the eXist db via the XQJ API. Therefore I have an XQuery file which I want to apply to several different documents inside different collections of the database.

My question is, how can I set the path to the document/collection? I want to apply the XQuery only on specific documents/collections and can´t set the path directly in the XQuery document (with the doc(‘path/to/doc’) function ), because I want to apply the same XQuery to several files with different paths.

I could bind a Java variable to an Xquery expression but there has to be a more elegant way to achieve this task with the XQJ API. Hope you can help me out a little bit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:37:19+00:00Added an answer on June 12, 2026 at 9:37 am

    If you know the specific document URIs up-front, you could bind a bunch of URIs as a xs:string sequence, where you can then iterate through them in your XQuery expression, performing operations against each URI as necessary.

    declare variable $uris as xs:string* external;
    
    for $uri in $uris
    return (
     (: perform operation against $uri :)
    )
    

    Or if you know the collection uri,

    declare variable $collection-uri as xs:string external;
    
    for $document-node in fn:collection($collection-uri)
    return (
      (: perform operation against document-node() :)
    )
    

    In a future version of eXist XQJ API, you will be able to set a collection as the default context, which goes against both the XQJ standard AND the XQuery 1.0 / 3.0 standards but other users appear to be wanting this functionality quite badly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want query a file xml with linq, i want get all descendat of
I want to query the server to see if the date is different than
I want a query which will return a combination of characters and number Example:
I want to query the datastore for Expando entities that have a certain dynamic
I have a table with dated records. I want a query that will show
I want make sql query which will insert values from one table to another
I want to query only the entries in table2 which contains a course value
I have a mysql database containing several items and I want to change top
I'm accepting dates from a wicket form - now I want query my DAO
I want to query posts in Wordpress by ID range. For example query posts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.