Bug 4031 - parse tag in xTag fail to validate dtd/schema on enumeration
Summary: parse tag in xTag fail to validate dtd/schema on enumeration
Status: CLOSED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: XTags Taglib (show other bugs)
Version: 1.0
Hardware: PC All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-08 16:28 UTC by tracy
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tracy 2001-10-08 16:28:45 UTC
We tried to use parse tag to validate xml with schema/dtd. Both dtd and schema 
validation failed to report errors on enumeration. For example, if i specified 
only "UK" and "USA" valid for name of a country. Parse tag fail to point out 
error on "ttt" for a country.
Comment 1 James Strachan 2001-10-09 03:33:03 UTC
I've added an extra tag attribute to <xtags:parse> to that XML validation can 
be enabled.

<xtags:parse validate="true">...

Note that if validation fails then a SAXException will occur which you must 
catch, or register a JSP page for the org.xml.sax.SAXException type in your 
web.xml and handle it gracefully.

A future enhancement could be to register a SAX ErrorHandler to turn all 
parsing errors into an XML document and return that, so that XPath could be 
used to iterate over all of the errors. 

There's an example implementation of a SAX ErrorHandler that does this here

http://dom4j.org/apidocs/org/dom4j/util/XMLErrorHandler.html

Though I've no immediate plans to implement this functionality. If you really 
need it, by all means submit a patch and I'll include it in the distribution.
Comment 2 tracy 2001-10-09 11:11:05 UTC
James:
Thank you for your quick response. I downloaded the newest veriosn of xtags. I 
checked the xtags.tld and cannot find out the "validate" attribute for parse 
tag. I also tested the newest version with <xtags:parse validate="true">..... I
got the following error:
org.apache.jasper.JasperException: Attribute validation invalid according to 
the specified TLD.
Which version is the updated version? Thanks.
Comment 3 Glenn Nielsen 2002-04-06 16:31:21 UTC
Verified that there is a validate attribute to the parse tag.  Closing bug.