|
[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
SAX parser validation with JRE 1.5
- To: xml-dev@l...
- Subject: SAX parser validation with JRE 1.5
- From: Rich Knox <rich@d...>
- Date: Wed, 24 Aug 2005 10:17:22 -0700
- Reply-to: rich@d...
- User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

I have code that uses the SAX parser provided with J2SE 1.4 and 1.5. We
have a
DTD we wish to validate against. When I run this code against JRE
1.4.2_07, everything works as expected. When I try to run it against
JRE 1.5.0_02, parser does not appear to be doing any validation against
our DTD. If I make the XML badly formed, we get an error in 1.4 but not
1.5. I know there are significant changes from 1.4 to 1.5. Is there
something special we need to do to enable validation? Here is the code
we use to create and configure the parser:
SAXParser parser;
XMLReader reader;
try
{
Properties props = System.getProperties();
props.list(System.out);
if (null == mFactory)
{
mFactory = SAXParserFactory.newInstance();
mFactory.setValidating(true);
}
parser = mFactory.newSAXParser();
reader = parser.getXMLReader();
}
catch (SAXException e)
{
// ...
}
catch (ParserConfigurationException e)
{
// ...
}
Thanks for any assistance you can give me on this.
-rich
|
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
 |
| Atom 0.3 |
 |
| |
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|