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 8899301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:49:25+00:00 2026-06-15T00:49:25+00:00

How can I execute the following XQuery on an XML file using javax.xml.xpath? for

  • 0

How can I execute the following XQuery on an XML file using javax.xml.xpath?

for $com in //RepoStatistics/Commits/Commit
  return 
    for $file in $com//File
      return element tuple {
        element path {
          string($file/Path)
        },
        element action {
          string($file/@action)
        },
        element date {
          string($com/@date)
        },
        element developer {
          string($com/@author)
        },
        element locAdd{
          if (not(empty($file/LocAdd)))
            then string($file/LocAdd)
            else 0
        },
        element locRem{
          if (not(empty($file/LocRem)))
            then string($file/LocRem)
            else 0
        }
      }

Excuse me if the question is stupid, but I am a very beginner.

  • 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-15T00:49:26+00:00Added an answer on June 15, 2026 at 12:49 am

    XPath is a subset of XQuery. The JDK comes with a built-in implementation of XPath, which can be used via the javax.xml.path API (the same API can also be used for other XPath implementations, such as Saxon and Jaxen). There is no XQuery engine delivered with the JDK, but a number are available from third parties; there are some lists of products on the W3C XQuery page, but an easy one to try out is Saxon. There is a “standard” API for accessing XQuery from Java called XQJ (package javax.xml.xquery), which Saxon and most other Java-based XQuery implementations support.

    (Saxon also has another interface called s9api, designed partly to get around the limitations of XQJ, and partly to provide a single integrated API that handles XSLT, XPath, XQuery, and XML Schema in a coherent way, allowing you to build applications that use all these technologies together.)

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

Sidebar

Related Questions

I wonder if I can execute some programs for different cmd's using .bat file.
How can I execute following command line code in an ant build file? cd
I can compile but can't execute the following code with the error (using Postgres):
I execute the following code using mvn exec:java com.mycompany.FooServer . I would like to
I'm using BaseX XQJ API to execute xquery queries on XML files within my
How can I execute the following query using Castle ActiveRecords and LINQ or HQL?
How can I execute the following SQL in a scalable way using JdbcTemplate running
From VB.net we can execute VBScript code by using following line: System.Diagnostics.Process.start(AbsolutePathofVBScriptfile) But how
To test if i can connect to my database, I execute the following code
I have following query which take more than a minute to execute, how can

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.