Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML parser to validate XML docs in my Servlet.

 
sreeni san
Ranch Hand
Posts: 39
  • 0
  • 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: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • 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
Pie
Posts: 20177
25
MySQL Database
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic