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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:36:54+00:00 2026-05-15T13:36:54+00:00

I have an XML as input to a Java function that parses it and

  • 0

I have an XML as input to a Java function that parses it and produces an output. Somewhere in the XML there is the word “stratégie”. The output is “stratgie”. How should I parse the XML as to get the “é” character as well?

The XML is not produced by myself, I get it as a response from a web service and I am positive that “stratégie” is included in it as “stratégie”.
In the parser, I have:

public List<Item> GetItems(InputStream stream) {

    try {

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(stream);
        doc.getDocumentElement().normalize();
        NodeList nodeLst = doc.getElementsByTagName("item");
        List<Item> items = new ArrayList<Item>();

        Item currentItem = new Item();
        Node node = nodeLst.item(0);
        if (node.getNodeType() == Node.ELEMENT_NODE) {
            Element item = (Element) node;
            if(node.getChildNodes().getLength()==0){
                return null;
            }


NodeList title = item.getElementsByTagName("title");
Element titleElmnt = (Element) title.item(0);
if (null != titleElmnt)
    currentItem.setTitle(titleElmnt.getChildNodes().item(0).getNodeValue());
....

Using the debugger, I can see that titleElmnt.getChildNodes().item(0).getNodeValue() is “stratgie” (without the é).

Thank you for your 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-05-15T13:36:55+00:00Added an answer on May 15, 2026 at 1:36 pm

    The answer was here: http://www.yagudaev.com/programming/java/7-jsp-escaping-html

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

Sidebar

Related Questions

i am new for XML.i have a function that takes four input.on the basis
I have XML in the following form that I want to parse with PHP
I have an input xml and corresponding java classes as the following. <Address> <name>name</name>
i have input xml as <content> <date> <day>14</day> <month>06</month> <year>2012</year> </date> </content> want it
This is my input xml. The xml can have maximunm three nodes and minimum
I have the following input XML: <root age=1> <description>some text</description> <section> <item name=a> <uuid>1</uuid>
I have written xml file which contains html tags as element like <component> <input
I have this use case of an xml file with input like Input: <abc
My java module gets a huge input xml from a mainframe. Unfortunately, the mainframe
I have this login.xhtml JSF page: <?xml version=1.0?> <jsp:root version=2.0 xmlns:jsp=http://java.sun.com/JSP/Page xmlns:f=http://java.sun.com/jsf/core xmlns:h=http://java.sun.com/jsf/html> <jsp:directive.page

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.