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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:41:41+00:00 2026-06-13T07:41:41+00:00

I am aware of SO question Failing to get element values using Element.getAttribute() but

  • 0

I am aware of SO question Failing to get element values using Element.getAttribute() but because I am java begginer, I have additional questions. What I am trying to build is simple application, which will read XML file and then compare it against “golden master.” My problem is:

  • I have lots of different XML files, which differ in attributes
  • The XML files are relatively big. (810 lines of filed – hard to check it by human eye)

Example of file:

  <DocumentIdentification v="Unique_ID"/>
  <DocumentVersion v="1"/>
  <DocumentType v="P81"/>
  <SenderIdentification v="TEST-001--123456" codingScheme="A01"/>
  <CreationDateTime v="2012-10-15T13:00:00Z"/>
  <InArea v="10STS-TST------W" codingScheme="A01"/>
  <OutArea v="10YWT-AYXOP01--8" codingScheme="A01"/>
  <TimeSeries>
<Period>
 <TimeInterval v="2012-10-14T22:00Z/2012-10-15T22:00Z"/>
   <Resolution v="PT15M"/>
        <Interval>
            <Pos v="1"/>
            <Qty v="500"/>
        </Interval>
        <Interval>
            <Pos v="2"/>
            <Qty v="500"/>
        </Interval>
        <Interval>
            <Pos v="3"/>
                            <Qty v="452"/>
                    </Interval>
                     ...
                     ...
                    <Interval>
            <Pos v="96"/>
                            <Qty v="891"/>
                    </Interval>
               </Period>   
        </TimeSeries>

Applying solution from the question mentioned above does not get me much further… I realised that I can cast attributes to NamedNodeMap but I dont know how to iterate through it programatically

Yes, I know it sounds much like “do my homework” but what I really need is at least small kick to butt, moving me in correct direction. Thanks for help

  • 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-13T07:41:42+00:00Added an answer on June 13, 2026 at 7:41 am

    The method item(int index) should help iterating through the attributes:

    NamedNodeMap map = getItFromSomeWhere();
    int i = 0;
    while ((Node node = map.item(i++)) != null) {
       // node is ith node in the named map
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am aware of Web Services and WCF but I have generic question with
I am aware that this question has been asked before, but I have tried
I'm aware of this question here but I have a slightly different question. If
I'm aware of this question , but the asker seems to have been content
I'm aware that this question may have been asked before, but I still haven't
I'm aware that variants of this question have been asked before, but I do
I am aware of another question that is quite similar, but for some reason
I'm aware it's a quite simple question but I'm a newbie to C#, ASP.NET
I aware that this will be a less programming question, but still... How can
I'm aware of several question on this forum relating to this. But I'm not

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.