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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:12:55+00:00 2026-05-12T20:12:55+00:00

I have an XML document with a section similar to the following: <release_list> <release>

  • 0

I have an XML document with a section similar to the following:

<release_list>
  <release>
    <id>100</id>
    <file_list>
      <file>
        <id>20</id>
      </file>
      <file>
        <id>21</id>
      </file>
    </file_list>
  </release>
  <release>
    <id>101</id>
    <file_list>
      <file>
        <id>22</id>
      </file>
      <file>
        <id>21</id>
      </file>
    </file_list>
  </release>
  <release>
    <id>102</id>
    <file_list>
      <file>
        <id>22</id>
      </file>
      <file>
        <id>23</id>
      </file>
    </file_list>
  </release>
</release_list>

At some point I have XSL for-each statements looping through each release, and in turn through each list of files. While I’m looping through each file, I want to get information about which other releases DO NOT contain that same file ID. (So for example, when I’m iterating through file 20 in release 100, I want to get pointers to both releases 101 and 102, but when I’m iterating through file 21 in that same package I want only a pointer to release 102.)

Is there a way to do this with XPath? The closest thing I’ve come up with is:

../../../release[ not( file_list/file/id = ./id ) ]

…which of course fails because within the square brackets the ‘./’ refers to the release in front of the brackets, not the file that the XPath statement is being called from.

Anything I’m missing here?

  • 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-05-12T20:12:55+00:00Added an answer on May 12, 2026 at 8:12 pm

    A good approach in XSLT to things like this is to use a variable at the outer level, and then you can compare against it in your selection path. So, for instance, something like

    <xsl:variable name="id" select="id" />
    <xsl:apply-templates select="/release_list/release[not(file_list/file/id = $id)]" />
    

    may help you.

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

Sidebar

Related Questions

If I have several Section elements in an XML document, what XQuery do I
I have an XML document looking similar to this: <items> <item cat=1 owner=14>bla</item> <item
Given the following partial XML document: <section> <entry typeCode=DRIV> <act classCode=AT moodCode=DEF> <statusCode code=completed/>
Suppose i have an xml document like this XML File: <document> <educationalsection> educational details
I have an XML document with un-namespaced elements, and I want to use XSLT
I have an XML document: var xml:XML = new XML(<rootNode> <head> <meta name=template content=Default
I have an XML document something like ::: <?xml version=1.0 encoding=utf-8?> <?mso-application progid=Excel.Sheet?> <Workbook
I have an XML document that I'm trying to style via CSS. A relevant
I have an xml document object that I need to convert into a string.
I have an xml document where an xml node with a particular name, say

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.