---
title: "SAX 读取XML"
author: "vicky_luo"
date: "2014-07-11T11:26:39Z"
tags: []
categories: ["非技术"]
slug: "sax-xml"
draft: false
lastmod: "2014-07-11T11:26:39Z"
id: 2090730
url: "https://vicky-luo.iteye.com/blog/2090730"
---

\[b]eachdata.xml\[/b] alipay@et361.com 解析 DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); File file = new File(path + File.separator + "eachdata" + File.separator + "eachdata.xml"); // System.out.println(file.getPath()); Document doc = docBuilder.parse (file.getPath()); doc.getDocumentElement ().normalize (); NodeList listOfPersons = doc.getElementsByTagName("countnum"); for(int s=0; s