Hi Mukul

Is there a way I can get the jars I need with this fix applied?
Up till now I've been using jars provided by the zip files which can be 
downloaded.

Thanks
George   

-----Original Message-----
From: Mukul Gandhi (JIRA) [mailto:[email protected]] 
Sent: 21 April 2014 16:40
To: George Cowe
Subject: [jira] [Resolved] (XERCESJ-1632) XERCES-J 2-11 beta - xsd:boolean 
value "1" not treated in the same way as "true" when dealing with XSD 1.1 
assertions


     [ 
https://issues.apache.org/jira/browse/XERCESJ-1632?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mukul Gandhi resolved XERCESJ-1632.
-----------------------------------

    Resolution: Not a Problem
      Assignee: Mukul Gandhi

this has been fixed in current SVN.

> XERCES-J 2-11 beta - xsd:boolean value "1" not treated in the same way 
> as "true" when dealing with XSD 1.1 assertions
> ----------------------------------------------------------------------
> -----------------------------------------------
>
>                 Key: XERCESJ-1632
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1632
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.11.0
>         Environment: Windows 64bit
>            Reporter: George Cowe
>            Assignee: Mukul Gandhi
>
> I've been using Xerces-J 2-11 with support for XML Schema 1.1 
> (Xerces-J-bin.2.11.0-xml-schema-1.1-beta.zip)
> I've noticed that it does not seem to treat the xsd:boolean value of "1" in 
> the same way as it treats the value "true". 
> "0" and "false" are treated correctly.
> This is in the context of assertions only, Xerces-J 2-11 without the schema 
> 1.1 support seems to be ok.   
> The example below demonstrates the issue. 
> If 'success_ind' is true or 1 then the assertion should catch the error.
> The example below passes schema validation when it shouldn't <?xml 
> version="1.0" encoding="UTF-8"?> <test:message 
> xmlns:test="http://test/schema/v1";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://test/schema/v1 test.xsd">
>   <test:success_ind>1</test:success_ind>
>   <test:error>Error details appear here</test:error> </test:message> 
> This example below fails schema validation as expected <?xml 
> version="1.0" encoding="UTF-8"?> <test:message 
> xmlns:test="http://test/schema/v1";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://test/schema/v1 test.xsd">
>   <test:success_ind>true</test:success_ind>
>   <test:error>Error details appear here</test:error> </test:message> 
> Using the schema test.xsd with the appropriate assertion <?xml 
> version="1.0" encoding="UTF-8"?> <xsd:schema 
> xmlns:test="http://test/schema/v1";
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
>    targetNamespace="http://test/schema/v1"; 
>    elementFormDefault="qualified" 
>    attributeFormDefault="qualified" 
>    version="1.0">
>    <xsd:complexType name="Message">
>       <xsd:sequence>
>          <xsd:element name="success_ind" type="xsd:boolean"/>
>          <xsd:element name="error" type="xsd:string" minOccurs="0"/>
>       </xsd:sequence>
>       <xsd:assert test="if (test:success_ind = false()) then test:error else 
> true()"/>
>       <xsd:assert test="if (test:success_ind = true()) then not(test:error) 
> else true()"/>
>    </xsd:complexType>
>    <xsd:element name="message" type="test:Message"/> </xsd:schema> 
> Sample Code
>        public boolean xmlValidate(String xmlFile, String schemaFile)
>        {
>               boolean valid = true;
>               File validatingXMLFile = new File(xmlFile);
>               File schemaXMLFile = new File(schemaFile);
>               try
>               {
>                      StreamSource schemaDocument = new 
> StreamSource(schemaXMLFile);
>                      Source instanceDocument = new 
> StreamSource(validatingXMLFile);
>                      SchemaFactory sf = 
> SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1";);
>                      Schema s = sf.newSchema(schemaDocument);
>                      Validator v = s.newValidator();
>                      v.validate(instanceDocument);
>                      System.out.println(xmlFile + " is valid");
>               } 
>               catch (Exception e) 
>               {
>                      System.out.println(xmlFile + " is not valid, exception=" 
> + e.getMessage());
>                      return false;
>               } 
>               return valid;
>        }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

E-mail disclaimer

The information in this e-mail is sent in confidence for the addressee only and 
may be legally privileged. Unauthorised recipients must preserve this 
confidentiality and should please advise the sender immediately of the error in 
transmission and then delete this e-mail. If you are not the intended 
recipient, any disclosure, copying, distribution or any action taken in 
reliance on its content is prohibited and may be unlawful.

Origo Services Limited accepts no responsibility for any loss or damage 
resulting directly or indirectly from the use of this e-mail or the contents. 
It is your responsibility to scan for viruses. Origo Services Limited reserves 
the right to monitor e-mails sent to or from addresses under its control. When 
you reply to this e-mail, you are consenting to Origo Services Limited 
monitoring the content of the e-mails you send to or receive from Origo 
Services Limited. If this e-mail is non-business related Origo Services Limited 
is not liable for any opinions expressed by the sender. The contents of this 
e-mail are protected by copyright. All rights reserved.

Origo Services Limited is a company incorporated in Scotland (company number 
115061) having its registered office at Moyen House, Heriot Watt Research Park 
North, Edinburgh, EH14 4AP

Reply via email to