I have got question about better way to parse xml package to get some info.
First of all this is my html response from server:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Invalid SID.</title>
</head>
<body>
<h2>HTTP ERROR: 404</h2>
<p>Problem accessing /http-bind/. Reason:
<pre> Invalid SID.</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>
This is openfire response when i send invalid frame. So i need to be sure that this status contains char sequence Invalid SID.
this is my code : res is object class = com.google.gwt.http.client.Response
if (res.getStatusCode() != Response.SC_OK){
final XMLPacket resXML = XMLBuilder.fromXML(res.getText());
if (resXML != null && resXML.getFirstChild("head") != null) {
for (XMLPacket subPacket : resXML.getChildren("head")) {
if (subPacket.toString().toUpperCase().contains("INVALID SID")) {
Log.debug("HURRA SUCCESS");
}
}
}
}
But i do not think that is the best way to do it. I am using GWT 2.5 . So my question is ther is better way to get info from html request using gwt ??