JSP DOM Parser of an XML file

I currently have an xml file called login.xml. It holds details on users profiles and usernames and passwords (this doesn抰 have to be secure). Basically I am having problems with the parser DOM. I抳e tried a few examples without success.

Here is an example of how my XML is formatted:

<?xml version="1.0" encoding="iso-8859-1"?>

<!-- Reference to a XML Schema-->

<login xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNameSpaceSchemaLocation="login.xsd">

<info>

<profile>

<username>roswhite</username>

<password>password</password>

<firstName>Rosanna</firstName>

<secondName>White</secondName>

<age>25</age>

<sex>female</sex>

<phoneNumber>222233</phoneNumber>

<emailAddress>r@a.com</emailAddress>

</profile>

I would like the parser to get the get the username, then the password element values, while looping through a for loop so then I can check if they match.

I am quite new to java/jsp so any help would be appreciated.

[1281 byte] By [coollittlewa] at [2007-11-26 19:48:42]
# 1
why don't u use [url= http://www.devx.com/Java/Article/21832]Digester[/url]
suparenoa at 2007-7-9 22:36:32 > top of Java-index,Java Essentials,Java Programming...
# 2
As a requirement I need to use DOM, I know there are proberbly other easier ways to do this.
coollittlewa at 2007-7-9 22:36:32 > top of Java-index,Java Essentials,Java Programming...
# 3
> As a requirement I need to use DOM, I know there are> proberbly other easier ways to do this.[url= http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/index.html]so you should read me[/url]
suparenoa at 2007-7-9 22:36:33 > top of Java-index,Java Essentials,Java Programming...
# 4
Maybe this will help you (if you can read german) http://de.selfhtml.org/javascript/objekte/node.htm
sspodafoa at 2007-7-9 22:36:33 > top of Java-index,Java Essentials,Java Programming...