Author: mukulg
Date: Wed Aug 24 07:49:55 2011
New Revision: 1160996
URL: http://svn.apache.org/viewvc?rev=1160996&view=rev
Log:
doing a schema 1.1 fix.
assert xpath expressions beginning with / or // are disallowed by the XSD 1.1
spec, since XDM trees on which assert xpath expressions work don't have a
document node. currently (before this commit), assert xpath expressions
beginning with / or // failed the assertion and also caused the XSD schema to
become invalid. flagging XSD schema invalid (for e.g since we are currently
reporting an error for this case) in such cases is not correct. it'll be more
better if we produce a warning in this case, and also say that the assert test
is false.
this commit makes these improvement.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java?rev=1160996&r1=1160995&r2=1160996&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java
Wed Aug 24 07:49:55 2011
@@ -146,7 +146,7 @@ public class AbstractPsychoPathXPath2Imp
} catch (XPathParserException ex) {
// error compiling XPath expression
if
(SchemaSymbols.ASSERT_XPATHEXPR_COMPILE_ERR_MESG_1.equals(ex.getMessage())) {
- fSchemaHandler.reportSchemaError("cvc-xpath.3.13.4.2b", new
Object[] {assertImpl.getTest().getXPath().toString(),
XSTypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())},
schemaContextElem);
+ fSchemaHandler.reportSchemaWarning("cvc-xpath.3.13.4.2b", new
Object[] {assertImpl.getTest().getXPath().toString(),
XSTypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())},
schemaContextElem);
}
else {
fSchemaHandler.reportSchemaError("cvc-xpath.3.13.4.2a", new
Object[] {assertImpl.getTest().getXPath().toString(),
XSTypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())},
schemaContextElem);
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java?rev=1160996&r1=1160995&r2=1160996&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Wed Aug 24 07:49:55 2011
@@ -4392,7 +4392,7 @@ public class XSDHandler {
}
}
- void reportSchemaWarning(String key, Object[] args, Element ele) {
+ public void reportSchemaWarning(String key, Object[] args, Element ele) {
reportSchemaWarning(key, args, ele, null);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]