Author: mukulg
Date: Sat Dec 18 11:46:28 2021
New Revision: 1896126
URL: http://svn.apache.org/viewvc?rev=1896126&view=rev
Log:
xercesj commit: minor improvements to XML Schema 1.1 xpath 2.0 regex
compliance. the characters 'x' and 'u' are not defined as escape characters, by
XPath 2.0 / XML Schema regex syntax and must be rejected during XML schema 1.1
processing. adding few test cases as well, for these improvements. The latest
xerces, xpath 2.0 codebase is located at https://github.com/xercesj/xpath20.
Added:
xerces/java/branches/xs-1.1-tests/data/assertions/regex_1.xsd
xerces/java/branches/xs-1.1-tests/data/assertions/regex_2.xsd
xerces/java/branches/xs-1.1-tests/data/assertions/regex_invalid_1.xml
xerces/java/branches/xs-1.1-tests/data/assertions/regex_valid_1.xml
Modified:
xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.1.jar
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.1.jar
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.1.jar?rev=1896126&r1=1896125&r2=1896126&view=diff
==============================================================================
Binary files - no diff available.
Added: xerces/java/branches/xs-1.1-tests/data/assertions/regex_1.xsd
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/regex_1.xsd?rev=1896126&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/regex_1.xsd (added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/regex_1.xsd Sat Dec 18
11:46:28 2021
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="X">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="a" type="xs:string"/>
+ </xs:sequence>
+ <xs:assert test="matches(a, 'hello[ ]+world')"/>
+ <xs:assert test="matches(a, 'hello[ ]+world')"/>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Added: xerces/java/branches/xs-1.1-tests/data/assertions/regex_2.xsd
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/regex_2.xsd?rev=1896126&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/regex_2.xsd (added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/regex_2.xsd Sat Dec 18
11:46:28 2021
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="X">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="a" type="xs:string"/>
+ </xs:sequence>
+ <xs:assert test="matches(a, 'hello[\x{0020}]+world')"/>
+ <xs:assert test="matches(a, 'hello[\u0020]+world')"/>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Added: xerces/java/branches/xs-1.1-tests/data/assertions/regex_invalid_1.xml
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/regex_invalid_1.xml?rev=1896126&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/regex_invalid_1.xml
(added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/regex_invalid_1.xml Sat
Dec 18 11:46:28 2021
@@ -0,0 +1,3 @@
+<X>
+ <a>helloworld</a>
+</X>
\ No newline at end of file
Added: xerces/java/branches/xs-1.1-tests/data/assertions/regex_valid_1.xml
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/regex_valid_1.xml?rev=1896126&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/regex_valid_1.xml (added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/regex_valid_1.xml Sat Dec
18 11:46:28 2021
@@ -0,0 +1,3 @@
+<X>
+ <a>hello world</a>
+</X>
\ No newline at end of file
Modified:
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java?rev=1896126&r1=1896125&r2=1896126&view=diff
==============================================================================
---
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java
(original)
+++
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java
Sat Dec 18 11:46:28 2021
@@ -2826,4 +2826,50 @@ public class AssertionTests extends Xerc
}
}
+ public void testAssert159() {
+ String xmlfile = fDataDir+"/assertions/regex_valid_1.xml";
+ String schemapath = fDataDir+"/assertions/regex_1.xsd";
+ try {
+ Schema s = fSchemaFactory.newSchema(new
StreamSource(schemapath));
+ Validator v = s.newValidator();
+ v.setErrorHandler(this);
+ v.validate(new StreamSource(xmlfile));
+ assertNull(fErrSysId);
+ assertNull(fFatErrSysId);
+ } catch(Exception ex) {
+ ex.printStackTrace();
+ assertTrue(false);
+ }
+ }
+
+ public void testAssert160() {
+ String xmlfile = fDataDir+"/assertions/regex_invalid_1.xml";
+ String schemapath = fDataDir+"/assertions/regex_1.xsd";
+ try {
+ Schema s = fSchemaFactory.newSchema(new
StreamSource(schemapath));
+ Validator v = s.newValidator();
+ v.setErrorHandler(this);
+ v.validate(new StreamSource(xmlfile));
+ assertTrue(failureList.size() == 2);
+ } catch(Exception ex) {
+ ex.printStackTrace();
+ assertTrue(false);
+ }
+ }
+
+ public void testAssert161() {
+ String xmlfile = fDataDir+"/assertions/regex_valid_1.xml";
+ String schemapath = fDataDir+"/assertions/regex_2.xsd";
+ try {
+ Schema s = fSchemaFactory.newSchema(new
StreamSource(schemapath));
+ Validator v = s.newValidator();
+ v.setErrorHandler(this);
+ v.validate(new StreamSource(xmlfile));
+ assertTrue(failureList.size() == 2);
+ } catch(Exception ex) {
+ ex.printStackTrace();
+ assertTrue(false);
+ }
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]