This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes XML parser to validate XML docs in my Servlet. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML parser to validate XML docs in my Servlet." Watch "XML parser to validate XML docs in my Servlet." New topic
Author

XML parser to validate XML docs in my Servlet.

sreeni san
Ranch Hand

Joined: Aug 14, 2001
Posts: 39
Hi,

I need to write an XML parser to validate two XML docs in my Servlet.

The Administator will have some features provisioned for the user, which will be stored as an Admin XML doc.

The user logs-in and will be presented with a page wherein the user can avail only the features enabled by the Admin. Once the user submits the form (the XML is generated in the front end and the same is posted to the Servlet), I need to validate/compare the user XML and Admin XML to check whether the user is eligible to avail a certain feature.


Admin XML will be as follows:

<Admin user="xyz">
<feature1 enabled="Y"/>
<feature2 enabled="N"/>
</Admin>

User XML will be as follows:

<User user="xyz">
<feature1 enabled="Y"><val>abcd</val></feature1>
<feature2 enabled="N"/>
</User>


Thanks,
Sreeni.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

Not a servlet issue, so this has been moved to the XML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Originally posted by sreeni san:
I need to write an XML parser to validate two XML docs in my Servlet.
I disagree. I think you should use the XML parser that's already built into Java 1.4 and later.
 
 
subject: XML parser to validate XML docs in my Servlet.