0

Xml response is like , but in one tag , the text is this:

<Description>
    &lt;center&gt;&lt;strong&gt;&lt;span&gt;Warehouse / Building Maintenance&lt;/span&gt;&lt;/strong&gt;&lt;/center&gt;&lt;br /&gt;
    &lt;br /&gt;
    &lt;strong&gt;&lt;span&gt;I&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;mmediate openings available in the local Perris area for warehouse/building building maintenance positions. &lt;br /&gt;
    &lt;br /&gt;
    &lt;strong&gt;Job Description:&lt;/strong&gt;&lt;br /&gt;
    &lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;span&gt;Associates will be responsible to define pieces of equipment that will paralyze operations if they fail, and plan whatever level of preventative maintenance necessary. &lt;br /&gt;
        &lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt
......
similar text
......
</Description>

I can't able to parse it in proper way.

I tried using Jsoup.parse((nodeValue))

and Html.fromHtml(String) also URLEncoder.encode(String)

but its returning simple & symbol thats it.

How to parse this type of response?

2 Answers 2

1

A temporary solution could be applying replaceAll("&lt;", "<").replaceAll("&gt;", ">") if API methods aren't working, but arent you supposed to use Html.toHtml(string) when you have stuff encoded and want it to become real html ?

Sign up to request clarification or add additional context in comments.

1 Comment

you mean the full string is replaced by & ?
0

Actually its returning only & symbol , that's because the nodelist item returns only single value.

After using like this:

NodeList fstNm = fstNmElmnt.getChildNodes();

                    System.out.println("nodefstnm"+fstNm.getLength());

                    for(int j=0;j<fstNm.getLength();j++) {
                       String val = ((Node) fstNm.item(j)).getNodeValue();
                       nodeValue=nodeValue.concat(val);
                    }

and then parsing with Jsoup., returns what I want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.