Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML parser to validate XML docs in my Servlet.

 
sreeni san
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a servlet issue, so this has been moved to the XML forum.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic