You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Priyanka (Updated) (JIRA)" <xm...@xml.apache.org> on 2011/10/17 16:11:11 UTC
[jira] [Updated] (XMLBEANS-470) Schema validation not working in
the java code for href tags
[ https://issues.apache.org/jira/browse/XMLBEANS-470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Priyanka updated XMLBEANS-470:
------------------------------
Attachment: invali.xml
xmlbeans-2.5.0.jar
> Schema validation not working in the java code for href tags
> ------------------------------------------------------------
>
> Key: XMLBEANS-470
> URL: https://issues.apache.org/jira/browse/XMLBEANS-470
> Project: XMLBeans
> Issue Type: Bug
> Reporter: Priyanka
> Priority: Critical
> Attachments: invali.xml, xmlbeans-2.5.0.jar
>
>
> Hi,
> We have just upgraded to xmlbeans 2.5.0 and after that schema validation for href tag has stoppred working.
> We've tried validating it using direct validate command prompt and then it works fine. But through java code, it says it is schema valid even though that is not the case.
> Attached is the jar we are using and the sample invalid xml.
> below is the java code to validate the message.
> protected boolean validateDocument(final Message doc) throws ValidationException {
> boolean valid = false;
> final List validationErrors = new ArrayList();
> final XmlOptions validationOptions = new XmlOptions();
> validationOptions.setErrorListener(validationErrors);
> if (!doc.validate(validationOptions)) {
> final Iterator iter = validationErrors.iterator();
> final StringBuffer details = new StringBuffer();
> while (iter.hasNext()) {
> details.append(iter.next() + "\n");
> }
> final String errorMsg = "Generated document failed schema validation! \n";
> EBlotterLog.STPLOG.debug("Message Schema Validation failed errors are::" + errorMsg + details);
> throw new ValidationException(errorMsg + details);
> } else {
> valid = true;
> }
> return valid;
> }
> Please note this was working fine till 2.3.0. When upgraded to 2.5.0, we have removed xmlbeans-qname jar as project is running on jdk 1.6
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org