-3

Possible Duplicate:
How to read an XML file with Java?

CLOSED

Community
  • 1
  • 1
WelcomeTo
  • 18,613
  • 51
  • 157
  • 276
  • [Here](http://stackoverflow.com/questions/7373567/java-how-to-read-and-write-xml-files/7373596#7373596) you can find a complete SAX example. Ignore the DTD if you do not want to use it. – Costis Aivalis Jan 27 '12 at 10:53

2 Answers2

0

There's only one element with grantee-template tag name. You seem to expect two. What you are really look for is its two children.

Michael Krelin - hacker
  • 131,515
  • 23
  • 189
  • 171
0

Replace your first statement

NodeList granteeTemplate = doc.getElementsByTagName("grantee-template")

with

NodeList granteeTemplate=doc.getDocumentElement().getChildNodes();
pavan
  • 3,095
  • 3
  • 20
  • 28