내 이름은 내가 당신의 당신에 따라 문자 그대로의 제어를 가져 오는에 의해 엔티티 또는 노드 AUR에 의해 그것을 할 수 똑같은하여 XML 파싱을했던 수석 안드로이드 개발자
입니다 Divy Dhiman입니다.
개인 클래스 MyAsyncTask이 잘못된 XML입니다 AsyncTask를 {
@Override
protected String doInBackground(String... abc) {
try {
URL url = new URL(jksbvlds);
URLConnection connection;
connection = url.openConnection();
HttpURLConnection httpConnection = (HttpURLConnection) connection;
int responseCode = httpConnection.getResponseCode();
if(responseCode == HttpURLConnection.HTTP_OK)
{
InputStream in = httpConnection.getInputStream();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document dom = db.parse(in);
Element docEle = dom.getDocumentElement();
NodeList nl = docEle.getElementsByTagName("quote");
if(nl != null && nl.getLength()>0)
{
for(int i = 0; i<nl.getLength();i++)
{
StockInfo theStock = getStockInformation(docEle);
name = theStock.getName();
yearLow = theStock.getYearLow();
yearHigh = theStock.getYearHigh();
daysLow = theStock.getDaysLow();
daysHigh = theStock.getDaysHigh();
lastTradePriceonly = theStock.getLastTradePriceonly();
change = theStock.getChange();
daysRange = theStock.getDaysRange();
}
}
}
}
catch(MalformedURLException e)
{
Log.d(TAG,"MalformedURLException",e);
}
catch(IOException e)
{
Log.d(TAG,"IOException",e);
}
catch (ParserConfigurationException e) {
Log.d(TAG,"ParserConfigurationException", e);
}
catch (SAXException e) {
Log.d(TAG,"SAXException",e);
}
finally{}
return null;
확장합니다. 파서는 이것을 파싱하는 동안 예외를 throw해야합니다. –
정확하기 때문에 ' ... '때문에 유효하지 않습니다. 시작 태그''와 종료 태그' '이 일치하지 않습니다. 시작 태그 ''가 누락되었거나 오타가 있었고 실제로 빈 제목 요소 ' '을 원했을 수 있습니다. 그러나 문제는 태그의 실체는 foo는 BR > < 구경에게 줄 줄 –
jasso
내 잘못, 그것은해야한다 (참고, 슬래시 * 후 * 요소 이름입니다) – user578953