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

  • Home
  • SEARCH
  • 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 4626636
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:26:58+00:00 2026-05-22T03:26:58+00:00

I have a Webservice(API) which I am passing to the DOM parser and it

  • 0

I have a Webservice(API) which I am passing to the DOM parser and it give the parsed result

Code reference :

public void parseContent(){
  URL url = new URL(http://My_Webservice_API);
  URLConnection con = url.openConnection();
  con.setConnectTimeout(5000);
  con.setReadTimeout(5000);
  Document doc = null;
  DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
  DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
  doc = docBuilder.parse(new InputSource(con.getInputStream()));
  doc.getDocumentElement().normalize ();
  NodeList TC = doc.getElementsByTagName("root");
  m_cTotalNo = TC.getLength();
  System.out.println("Total no of elements : " + m_cTotalNo);
}

Every thing works fine. The parser breaks on "<element>5>7</element> " . Please put some light how to handle the special character.

  • 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-22T03:26:59+00:00Added an answer on May 22, 2026 at 3:26 am

    The forward slash is valid as is and
    does not need further encoding.

    The only reserved characters are:

    > < & %

    XML Entity for "/"?

    If the parser really breaks on this (and not on some other character), then that is a bug.

    You should encode > as &gt; in XML.

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

Sidebar

Related Questions

I have some code I've written in PHP for consuming our simple webservice, which
I have a php webservice which can be called (from mobile phones) to perform
I am currently building an API which will be used by a webservice. I
I have C++ HTTP code on the client side which will communicate with a
I have some POJOs which are the basis for this RESTful API I am
I have the following php code (getRout.php).. which response results in xml formats ...
I have created a webservice which takes a HashMap as parameter. I generated the
I have a simple web service that has an API third party developers are
I have an API consisting of ASP.NET webservices callable through GET/POST/SOAP. A new functionality
Several web service APIs have you sign up for an API key. For example,

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.