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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:16:04+00:00 2026-06-10T20:16:04+00:00

I have One XML file which will be look like this :: <Note> <NoteId>13328</NoteId>

  • 0

I have One XML file which will be look like this ::

<Note>
     <NoteId>13328</NoteId>
     <NoteTitle>hiiiii</NoteTitle>
     <NoteDescription>Hi</NoteDescription>
</Note>

I am successfully parse this kind of XML.My Problem is that when i fired the webservice and if there is no authentication from the server then the webservice response like this::

<AuthenticationError>An Active Session Already Exists For This User.</AuthenticationError>

So how can i check that root node is “Authentication Error” or “Notes”.
And if i get the Authentication Error tag then how can i get its node value which is “An Active Session Already Exists For This User.”??

My Code for XML Parsing is this::

     Element node=null;

node = (Element)result.getElementsByTagName("Notes").item(0);
websiteList = node.getElementsByTagName("Note");

for(int j=0;j<websiteList.getLength();j++)
{                               
    Element checkNode=(Element)websiteList.item(j);
    MessagesInbox msg_inbox=new MessagesInbox();

    msg_inbox.note_id = getValueFromNode(checkNode,"NoteId");
    msg_inbox.note_title = getValueFromNode(checkNode,"NoteTitle");
    msg_inbox.note_description = getValueFromNode(checkNode,"NoteDescription");


    arr_msg_inbox_list.add(msg_inbox);
}

I hope my question is clear…
Please provide the solution asap.
Thanks in Advance….

  • 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-10T20:16:05+00:00Added an answer on June 10, 2026 at 8:16 pm

    You can get root node reference via calling this method – document.getDocumentElement().

    Element root=document.getDocumentElement();
    if(root.getNodeName().equals("AuthenticationError")){
      //get text content 
       String str=root.getTextContent();
    }else{
      //
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file which has many section like the one below: <Operations>
I have a sample xml file which looks like the one below: <Root> <SubOne>
I have an xml file like below which I will use to set background
I have one .net windows application I'm trying to read .xml file from c#
I have one problem , I want to get some data from XML file
i have an xml file sitemap.xml as shown below ..i need to add one
I have generated an XML file that and one of the nodes contains data
I have an XML file that I'm trying to parse with Linq-to-XML. One of
I have a php file setup to pull through ONE XML data feed, What
I am new to MVC and facing one issue. I have a xml file

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.