안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요 오늘도 불철 주야 개발에 매진 하시느라 수고가 많으 십니다.
이번에 HTML 로 데이터를 변환 하면서 TransformerFactory 을 썼는데   테그가 밑에서 처럼의 처리과정을 거치면
사라져 버립니다. ㅜㅜ 왜인지 도저희 이유를 모르겠네요 아시는분 계시면 조그마한 도움 부탁 드리겠습니다,ㅜㅜ
TransformerFactory factory = TransformerFactory.newInstance();
try {
Properties output = new Properties();
output.setProperty(OutputKeys.INDENT, "yes");
output.setProperty(OutputKeys.ENCODING, "UTF-8");
Transformer transformer = factory.newTransformer();
transformer.setOutputProperties(output);
transformer.transform(new DOMSource(mDocument), new StreamResult(sw));
}
catch (TransformerConfigurationException e) {
e.printStackTrace();
}
catch (TransformerException e) {
e.printStackTrace();
}
//resultString = sw.toString();
resultString = sw.getBuffer ().toString ();
sw = null;
if(LOG_ENABLED) Log.d(LOGTAG, "documentWriter3 rst:"+resultString);
*/
return resultString;
이번에 HTML 로 데이터를 변환 하면서 TransformerFactory 을 썼는데   테그가 밑에서 처럼의 처리과정을 거치면
사라져 버립니다. ㅜㅜ 왜인지 도저희 이유를 모르겠네요 아시는분 계시면 조그마한 도움 부탁 드리겠습니다,ㅜㅜ
TransformerFactory factory = TransformerFactory.newInstance();
try {
Properties output = new Properties();
output.setProperty(OutputKeys.INDENT, "yes");
output.setProperty(OutputKeys.ENCODING, "UTF-8");
Transformer transformer = factory.newTransformer();
transformer.setOutputProperties(output);
transformer.transform(new DOMSource(mDocument), new StreamResult(sw));
}
catch (TransformerConfigurationException e) {
e.printStackTrace();
}
catch (TransformerException e) {
e.printStackTrace();
}
//resultString = sw.toString();
resultString = sw.getBuffer ().toString ();
sw = null;
if(LOG_ENABLED) Log.d(LOGTAG, "documentWriter3 rst:"+resultString);
*/
return resultString;