나는 W3C DOMXML 파서
<html>
<div id='token' style='display:none;'>
n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs=
</div>
</html>
를 사용하여 n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs=
를 추출하기 위해 노력하고있어하지만 난 누군가가 몇 가지 기본적인 튜토리얼 날 지점시겠습니까
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(con.getInputStream());
NodeList list = doc.getElementsByTagName("div");
붙어 것 같다 그 날 해결 도움이 될 내 양도 논법. 감사합니다. .
편집 : 나는 그것이 작동 할 수 있지만,이 토큰을 얻을 수있는 예뻐 방법은
String token;
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(con.getInputStream());
Element root = doc.getDocumentElement();
NodeList items = root.getElementsByTagName("html");
for(int i = 0; i < items.getLength(); i++) {
Message message = new Message();
Node item = items.item(i);
NodeList properties = item.getChildNodes();
for(int j = 0; j < properties.getLength(); j++) {
Node property = properties.item(j);
String name = property.getNodeName();
if(name.equalsIgnoreCase("div")) {
token = property.getFirstChild().getNodeValue());
}
}
}
어설픈 조금있을 것 같다 가지고
좋아? 내 CML 문서가 거대한 아니지만 내 경우 VTD-XML 파서에서
는 어떻게 붙어 있습니까? –
그래, 조금 편집 해 봤어. – lemon
은 DOM이 유일한 옵션인가? –