Hello,
I am beginer in XML and I am confused with such a huge documentation on XML.
For the project I am working on, we thought of using an xml file for application configuration and get the configuration values as and when required by the application. I thought I would parse my xml file and keep that in memory by running a
servlet on server startup. Servlet would call my parser program. I guess I should go for DOM parser.
In this scenario, I am confused if I have to use SAX parser or DOM parser. Using these parsers will I be able to get the value of the configuration paramter from the XML document given name of the configuration parameter as input? (In my case it would be tag name)
Sample program would be a great help to me.
When I write a dtd for my xml file and try to validate it I am getting SAXException. I am using Jbuilder validator to validate my XML file. I guess by default it uses SZX parser to validate.
Here are the DTD and XML files.
-------------
<!ELEMENT application-security ( application-account-code, database-environment-code, environment-description, chances-before-revoked ) >
<!ELEMENT application-account-code ( #PCDATA ) #REQUIRED>
<!ELEMENT chances-before-revoked ( #PCDATA ) #REQUIRED>
<!ELEMENT database-environment-code ( #PCDATA ) #REQUIRED>
<!ELEMENT environment-description ( #PCDATA ) #IMPLIED>
-------------
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE application-security SYSTEM "AppSecurity.dtd">
<application-security>
<application-account-code>FA</application-account-code>
<database-environment-code>P1</database-environment-code>
<environment-description>Production</environment-description>
<chances-before-revoked>3</chances-before-revoked>
</application-security>
-------------
If anyone could tell me what went wrong and How I should proceed futher would be a great help to me.
early replys are greatly appreciated.
Thank you very much inadvance
Saritha