svn commit: r1453664 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Thu Mar 7 02:38:03 2013 New Revision: 1453664 URL: http://svn.apache.org/r1453664 Log: committing fix for jira issue XERCESJ-1608, along with few test cases. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1453664r1=1453663r2=1453664view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1453665 - in /xerces/java/branches/xs-1.1-tests: data/jira_bugs/1608_1.xml data/jira_bugs/1608_1.xsd data/jira_bugs/1608_2.xml src/org/apache/xerces/tests/JiraBugsTests.java
Author: mukulg Date: Thu Mar 7 02:38:26 2013 New Revision: 1453665 URL: http://svn.apache.org/r1453665 Log: committing fix for jira issue XERCESJ-1608, along with few test cases. Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml?rev=1453665view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml Thu Mar 7 02:38:26 2013 @@ -0,0 +1,5 @@ +test xmlns=http://www.rackspace.com/test/duration; +dPT22H/d +dPT1H/d +dPT1H/d +/test \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd?rev=1453665view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd Thu Mar 7 02:38:26 2013 @@ -0,0 +1,16 @@ +schema +elementFormDefault=qualified +attributeFormDefault=unqualified +xmlns=http://www.w3.org/2001/XMLSchema; +xmlns:xsd=http://www.w3.org/2001/XMLSchema; +xmlns:tst=http://www.rackspace.com/test/duration; +targetNamespace=http://www.rackspace.com/test/duration; +element name=test type=tst:SumDuration24H/ +complexType name=SumDuration24H +sequence +element name=d type=xsd:dayTimeDuration maxOccurs=unbounded/ +/sequence + assert test=xsd:dayTimeDuration('PT24H') = sum(tst:d)/ +assert test=xsd:dayTimeDuration('PT24H') = sum(for $d in element(tst:d) return $d)/ +/complexType +/schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml?rev=1453665view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml Thu Mar 7 02:38:26 2013 @@ -0,0 +1,5 @@ +test xmlns=http://www.rackspace.com/test/duration; +dPT24H/d +dPT1H/d +dPT1H/d +/test \ No newline at end of file Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java?rev=1453665r1=1453664r2=1453665view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Thu Mar 7 02:38:26 2013 @@ -370,5 +370,36 @@ public class JiraBugsTests extends Xerce assertEquals(cos-nonambig: Element1 and Element1 (or elements from their substitution group) violate \Unique Particle Attribution\. During validation against this schema, ambiguity would be created for those two particles., ex.getMessage()); } } + + public void testJira_1608_1() { + String xmlfile = fDataDir+/jira_bugs/1608_1.xml; + String schemapath = fDataDir+/jira_bugs/1608_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 testJira_1608_2() { + String xmlfile = fDataDir+/jira_bugs/1608_2.xml; + String schemapath = fDataDir+/jira_bugs/1608_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
svn commit: r1446413 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XS11Constraints.java models/XS11CMRestriction.java util/XS11TypeHelper.java
Author: mukulg Date: Fri Feb 15 00:37:09 2013 New Revision: 1446413 URL: http://svn.apache.org/r1446413 Log: commiting fix for jira issue XERCESJ-1605. commiting few related test cases as well. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XS11Constraints.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XS11CMRestriction.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XS11Constraints.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XS11Constraints.java?rev=1446413r1=1446412r2=1446413view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XS11Constraints.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XS11Constraints.java Fri Feb 15 00:37:09 2013 @@ -29,6 +29,7 @@ import org.apache.xerces.impl.xs.models. import org.apache.xerces.impl.xs.models.XS11CMRestriction; import org.apache.xerces.impl.xs.models.XSCMValidator; import org.apache.xerces.impl.xs.util.SimpleLocator; +import org.apache.xerces.impl.xs.util.XS11TypeHelper; import org.apache.xerces.impl.xs.util.XSObjectListImpl; import org.apache.xerces.util.NamespaceSupport; import org.apache.xerces.util.SymbolHash; @@ -133,8 +134,8 @@ class XS11Constraints extends XSConstrai // Types are not the same throw new XMLSchemaException(cos-element-consistent, new Object[] {type.fName, elem.fName}); } - -if (!isTypeTablesEquivalent(elem, existingElem)) { + +if (XS11TypeHelper.isTypeTablesComparable(elem.getTypeAlternatives(), existingElem.getTypeAlternatives()) !isTypeTablesEquivalent(elem, existingElem)) { // Type tables are not equivalent throw new XMLSchemaException(cos-element-consistent.4.b, new Object[] {type.fName, elem.fName}); } @@ -185,7 +186,7 @@ class XS11Constraints extends XSConstrai if (grammar != null) { final XSElementDecl gElem = grammar.getGlobalElementDecl(elem.fName); if (gElem != null) { -if (gElem != elem !isTypeTablesEquivalent(elem, gElem)) { +if (gElem != elem XS11TypeHelper.isTypeTablesComparable(elem.getTypeAlternatives(), gElem.getTypeAlternatives()) !isTypeTablesEquivalent(elem, gElem)) { // Type tables are not equivalent throw new XMLSchemaException(cos-element-consistent.4.b, new Object[] {type.fName, elem.fName}); } @@ -200,29 +201,33 @@ class XS11Constraints extends XSConstrai */ final public boolean isTypeTablesEquivalent(XSElementDecl elementDecl1, XSElementDecl elementDecl2) { +boolean typeTablesEquivalent = true; + final XSTypeAlternativeImpl[] typeTable1 = elementDecl1.getTypeAlternatives(); final XSTypeAlternativeImpl[] typeTable2 = elementDecl2.getTypeAlternatives(); - -// both tables are absent -if (typeTable1 == typeTable2) { -return true; -} -// one of the tables is absent or has a different length -if (typeTable1 == null || typeTable2 == null -|| typeTable1.length != typeTable2.length) { -return false; +// if two type tables have different length +if (typeTable1.length != typeTable2.length) { +typeTablesEquivalent = false; } -for (int typeAltIdx = 0; typeAltIdx typeTable1.length; typeAltIdx++) { -final XSTypeAlternativeImpl typeAlt1 = typeTable1[typeAltIdx]; -final XSTypeAlternativeImpl typeAlt2 = typeTable2[typeAltIdx]; -if (!isTypeAlternativesEquivalent(typeAlt1, typeAlt2)) { -return false; +if (typeTablesEquivalent) { +for (int typeAltIdx = 0; typeAltIdx typeTable1.length; typeAltIdx++) { +final XSTypeAlternativeImpl typeAlt1 = typeTable1[typeAltIdx]; +final XSTypeAlternativeImpl typeAlt2 = typeTable2[typeAltIdx]; +if (!isTypeAlternativesEquivalent(typeAlt1, typeAlt2)) { +typeTablesEquivalent = false; +break; +} } } -return isTypeAlternativesEquivalent(elementDecl1.getDefaultTypeDefinition(), elementDecl2.getDefaultTypeDefinition()); +if (typeTablesEquivalent !elementDecl1.isTypeTableOK()) { +typeTablesEquivalent = isTypeAlternativesEquivalent(elementDecl1.getDefaultTypeDefinition(), elementDecl2.getDefaultTypeDefinition
svn commit: r1446414 - in /xerces/java/branches/xs-1.1-tests: data/jira_bugs/1603_1.xsd data/jira_bugs/1605_1.xsd src/org/apache/xerces/tests/JiraBugsTests.java
Author: mukulg Date: Fri Feb 15 00:37:37 2013 New Revision: 1446414 URL: http://svn.apache.org/r1446414 Log: commiting fix for jira issue XERCESJ-1605. commiting few related test cases as well. Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1603_1.xsd xerces/java/branches/xs-1.1-tests/data/jira_bugs/1605_1.xsd Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1603_1.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1603_1.xsd?rev=1446414view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1603_1.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1603_1.xsd Fri Feb 15 00:37:37 2013 @@ -0,0 +1,21 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; elementFormDefault=qualified +xs:defaultOpenContent mode=interleave +xs:any namespace=##targetNamespace/ +/xs:defaultOpenContent +xs:complexType name=mainCT +xs:all +xs:element name=elemA type=mainCT/ +/xs:all +/xs:complexType +xs:complexType name=bCT +xs:complexContent +xs:extension base=mainCT +xs:openContent mode=interleave +/xs:openContent +xs:all +xs:element name=elemB/ +/xs:all +/xs:extension +/xs:complexContent +/xs:complexType +/xs:schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1605_1.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1605_1.xsd?rev=1446414view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1605_1.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1605_1.xsd Fri Feb 15 00:37:37 2013 @@ -0,0 +1,26 @@ +xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema; + +xsd:complexType name=type1 +xsd:choice +xsd:sequence +xsd:element name=Element1 +xsd:alternative test=@index='3' type=TypeI3/ +xsd:alternative type=TypeI5/ +/xsd:element +/xsd:sequence +xsd:sequence +xsd:element name=Element1 +xsd:alternative test=@index='3' type=TypeI3/ +xsd:alternative type=TypeI5/ +xsd:unique name=TypeI5_U +xsd:selector xpath=*/ +xsd:field xpath=@index/ +/xsd:unique +/xsd:element +/xsd:sequence +/xsd:choice +/xsd:complexType +xsd:complexType name=TypeI3/ +xsd:complexType name=TypeI5/ + +/xsd:schema \ No newline at end of file Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java?rev=1446414r1=1446413r2=1446414view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Fri Feb 15 00:37:37 2013 @@ -25,6 +25,8 @@ import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; +import org.xml.sax.SAXException; + /** * @xerces.internal * @@ -348,5 +350,25 @@ public class JiraBugsTests extends Xerce assertTrue(false); } } + + public void testJira_1603() { + String schemapath = fDataDir+/jira_bugs/1603_1.xsd; + try { + Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath)); + } catch(SAXException ex) { + // test expected error messages + assertEquals(src-ct.5: Complex Type Definition Representation Error for type 'bCT'. If openContent is present and the actual value of its mode [attribute] is not none, then there must be an any among the [children] of openContent., ex.getMessage()); + } + } + + public void testJira_1605() { + String schemapath = fDataDir+/jira_bugs/1605_1.xsd; + try { + Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath)); + } catch(SAXException ex) { + // test expected error messages +assertEquals(cos-nonambig: Element1 and Element1 (or elements from their substitution group) violate \Unique Particle Attribution\. During validation against this schema, ambiguity would
svn commit: r1436091 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Mon Jan 21 01:57:13 2013 New Revision: 1436091 URL: http://svn.apache.org/viewvc?rev=1436091view=rev Log: committing minor improvements to variable comments Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1436091r1=1436090r2=1436091view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Mon Jan 21 01:57:13 2013 @@ -1411,12 +1411,13 @@ public class XMLSchemaValidator // assertion validator subcomponent private XSDAssertionValidator fAssertionValidator = null; -// variable to track validity of element simple content for union types. if a member type of union in XML Schema namespace can -// successfully validate an atomic value, we don't process assertions for such union types in downstream checks. i.e, a known -// valid element doesn't require assertion evaluations. +// variable to track validity of element content for simpleType-union. if a member type of union in XSD namespace can +// successfully validate an element instance value, we don't process assertions for such union types in downstream checks. i.e., +// an element instance known to be valid doesn't require assertion evaluations. private boolean fIsAssertProcessingNeededForSTUnionElem = true; -// a similar variable as above to track union type validity for attributes of one element. +// variable with similar semantics as fIsAssertProcessingNeededForSTUnionElem, but for attributes of an element instance (i.e., +// all attributes of one element instance). private List fIsAssertProcessingNeededForSTUnionAttrs = new ArrayList(); // 'type alternative' validator subcomponent - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1432596 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: msg/XMLSchemaMessages.properties xs/XMLSchemaValidator.java
Author: mukulg Date: Sun Jan 13 12:11:15 2013 New Revision: 1432596 URL: http://svn.apache.org/viewvc?rev=1432596view=rev Log: committing few fixes for Jira issue, 1594 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1432596r1=1432595r2=1432596view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Sun Jan 13 12:11:15 2013 @@ -44,7 +44,7 @@ KeyRefOutOfScope = Identity Constraint error: the keyref identity constraint \{0}\ refers to a key or unique that is out of scope. KeyRefReferNotFound = Key reference declaration \{0}\ refers to unknown key with name \{1}\. UnknownField = Internal identity constraint error; unknown field \{0}\ for identity constraint \{2}\ specified for element \{1}\. -KeyRefNotEnoughValues = cvc-identity-constraint.4.3.b: Not enough values specified for keyref name=\{1}\ identity constraint specified for element \{0}\. +## KeyRefNotEnoughValues = cvc-identity-constraint.4.3.b: Not enough values specified for keyref name=\{1}\ identity constraint specified for element \{0}\. # Ideally, we should only use the following error keys, not the ones under # Identity constraints. And we should cover all of the following errors. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1432596r1=1432595r2=1432596view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Sun Jan 13 12:11:15 2013 @@ -2771,11 +2771,11 @@ public class XMLSchemaValidator ValueStoreBase values = fValueStoreCache.getValueStoreFor(id, selMatcher.getInitialDepth()); if (values != null) { -values.endDocumentFragment(); // nothing to do if nothing matched -// report error if not all fields are present -if (values.fValuesCount != values.fFieldCount) { +values.endDocumentFragment(); // nothing to do if nothing matched +/*if (values.fValuesCount != values.fFieldCount) { +// report error if not all fields are present reportSchemaError(KeyRefNotEnoughValues, new Object[] { element.rawname, values.getIdentityConstraint().getName() }); -} +} */ } } } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1432599 - in /xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests: IDConstraintTests.java JiraBugsTests.java
Author: mukulg Date: Sun Jan 13 12:12:52 2013 New Revision: 1432599 URL: http://svn.apache.org/viewvc?rev=1432599view=rev Log: making few updates to test cases for recent implementation changes for Jira issue, 1594 Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java?rev=1432599r1=1432598r2=1432599view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java Sun Jan 13 12:12:52 2013 @@ -303,13 +303,10 @@ public class IDConstraintTests extends X Validator v = s.newValidator(); v.setErrorHandler(this); v.validate(new StreamSource(xmlfile)); -assertTrue(failureList.size() == 2); +assertTrue(failureList.size() == 1); // test expected error messages List expectedMsgList = new ArrayList(); FailureMesgFragments mesgFragments = new FailureMesgFragments(); -mesgFragments.setMessageFragment(cvc-identity-constraint.4.3.b: Not enough values specified for keyref name=\newKeyref\ identity constraint specified for element \Sub_1a\); -expectedMsgList.add(mesgFragments); -mesgFragments = new FailureMesgFragments(); mesgFragments.setMessageFragment(the keyref identity constraint \newKeyref\ refers to a key or unique that is out of scope); expectedMsgList.add(mesgFragments); assertTrue(areErrorMessagesConsistent(expectedMsgList)); @@ -327,13 +324,10 @@ public class IDConstraintTests extends X Validator v = s.newValidator(); v.setErrorHandler(this); v.validate(new StreamSource(xmlfile)); -assertTrue(failureList.size() == 2); +assertTrue(failureList.size() == 1); // test expected error messages List expectedMsgList = new ArrayList(); FailureMesgFragments mesgFragments = new FailureMesgFragments(); -mesgFragments.setMessageFragment(cvc-identity-constraint.4.3.b: Not enough values specified for keyref name=\keyref\ identity constraint specified for element \personnel\); -expectedMsgList.add(mesgFragments); -mesgFragments = new FailureMesgFragments(); mesgFragments.setMessageFragment(cvc-identity-constraint.4.3: Key 'keyref' with value '1' not found for identity constraint of element 'personnel'); expectedMsgList.add(mesgFragments); assertTrue(areErrorMessagesConsistent(expectedMsgList)); Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java?rev=1432599r1=1432598r2=1432599view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Sun Jan 13 12:12:52 2013 @@ -117,7 +117,7 @@ public class JiraBugsTests extends Xerce Validator v = s.newValidator(); v.setErrorHandler(this); v.validate(new StreamSource(xmlfile)); -assertTrue(failureList.size() == 2); +assertTrue(failureList.size() == 1); // test expected error messages List expectedMsgList = new ArrayList(); FailureMesgFragments mesgFragments = new FailureMesgFragments(); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1429869 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java
Author: mukulg Date: Mon Jan 7 16:09:33 2013 New Revision: 1429869 URL: http://svn.apache.org/viewvc?rev=1429869view=rev Log: schema 1.1 commit: improving computing typed value of assertion xpath2 context variable $value, during following scenario, $value represents value for a simpleType which is derived by restriction from a list and itemType of that list is a union. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java?rev=1429869r1=1429868r2=1429869view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java Mon Jan 7 16:09:33 2013 @@ -124,8 +124,7 @@ public class XSAssertionXPath2ValueImpl if (listOrUnionType != null) { if (isTypeDerivedFromList || listOrUnionType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST) { -// $value is a sequence of atomic values (with type annotation xs:anyAtomicType*) -// tokenize the list value by a sequence of white spaces +// $value is a sequence of atomic values (with type annotation xs:anyAtomicType*). tokenize the list value by a sequence of white spaces. StringTokenizer listStrTokens = new StringTokenizer(value, \n\t\r); List xdmItemList = new ArrayList(); while (listStrTokens.hasMoreTokens()) { @@ -185,10 +184,17 @@ public class XSAssertionXPath2ValueImpl public void setXDMTypedValueOf$valueForSTVarietyList(Element rootNodeOfAssertTree, String listStrValue, XSSimpleTypeDefinition itemType, boolean isTypeDerivedFromList, DynamicContext xpath2DynamicContext) throws Exception { if (itemType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) { - // the list's item type has variety 'union' - XSSimpleTypeDefinition actualListItemType = getActualXDMItemTypeForSTVarietyUnion(itemType.getMemberTypes(), listStrValue); - // set a schema 'typed value' to variable $value - setXDMTypedValueOf$value(rootNodeOfAssertTree, listStrValue, actualListItemType, null, false, xpath2DynamicContext); + // itemType of xs:list has variety 'union' + List xdmItemList = new ArrayList(); + XSObjectList memberTypes = itemType.getMemberTypes(); + // tokenize the list value by a sequence of white spaces + StringTokenizer values = new StringTokenizer(listStrValue, \n\t\r); + while (values.hasMoreTokens()) { + String itemValue = values.nextToken(); + XSSimpleTypeDefinition listItemTypeForUnion = getActualXDMItemTypeForSTVarietyUnion(memberTypes, itemValue); + xdmItemList.add(SchemaTypeValueFactory.newSchemaTypeValue(listItemTypeForUnion.getBuiltInKind(), itemValue)); + } + xpath2DynamicContext.set_variable(new org.eclipse.wst.xml.xpath2.processor.internal.types.QName(value), XS11TypeHelper.getXPath2ResultSequence(xdmItemList)); } else { setXDMTypedValueOf$value(rootNodeOfAssertTree, listStrValue, itemType, null, isTypeDerivedFromList, xpath2DynamicContext); @@ -228,13 +234,12 @@ public class XSAssertionXPath2ValueImpl if (complexTypeSimplContentType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST) { // simple content type has variety xs:list XSSimpleTypeDefinition listItemType = complexTypeSimplContentType.getItemType(); -// tokenize the list value by a sequence of white spaces -StringTokenizer values = new StringTokenizer(value, \n\t\r); -// $value is a sequence of atomic values (with type annotation xs:anyAtomicType*) +// $value is a sequence of atomic values (with type annotation xs:anyAtomicType*). tokenize the list value by a sequence of white spaces. +StringTokenizer values = new StringTokenizer(value, \n\t\r); List xdmItemList = new ArrayList(); -final XSObjectList memberTypes = listItemType.getMemberTypes(); -if (memberTypes.getLength() 0) { - // itemType of xs:list has variety 'union'. here list items may have different types which are determined below. +if (listItemType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) { + // itemType of xs:list has variety 'union' + final XSObjectList memberTypes
svn commit: r1429874 - in /xerces/java/branches/xs-1.1-tests: data/assertions/list_union/ src/org/apache/xerces/tests/
Author: mukulg Date: Mon Jan 7 16:14:56 2013 New Revision: 1429874 URL: http://svn.apache.org/viewvc?rev=1429874view=rev Log: schema 1.1 commit: adding few new test cases, for implementation improvements done few minutes ago and for earlier improvements as well. Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_1.xml - copied unchanged from r1429470, xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml Removed: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml?rev=1429874view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml Mon Jan 7 16:14:56 2013 @@ -0,0 +1 @@ +X5/X \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd?rev=1429874view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd Mon Jan 7 16:14:56 2013 @@ -0,0 +1,21 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; + + xs:element name=X + xs:simpleType +xs:restriction base=ST1 + xs:assertion test=count($value) eq 2/ + xs:assertion test=$value[1] instance of xs:integer/ + xs:assertion test=$value[2] instance of xs:date/ +/xs:restriction + /xs:simpleType + /xs:element + + xs:simpleType name=ST1 + xs:list + xs:simpleType +xs:union memberTypes=xs:integer xs:date/ + /xs:simpleType + /xs:list + /xs:simpleType + +/xs:schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml?rev=1429874view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml Mon Jan 7 16:14:56 2013 @@ -0,0 +1 @@ +X2 2005-10-05/X \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml?rev=1429874view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml Mon Jan 7 16:14:56 2013 @@ -0,0 +1 @@ +X2005-10-05 2/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=1429874r1=1429873r2=1429874view=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 Mon Jan 7 16:14:56 2013 @@ -2765,7 +2765,7 @@ public class AssertionTests extends Xerc } public void testAssert155() { - String xmlfile = fDataDir+/assertions/list_union/listunion18.xml; + String xmlfile = fDataDir+/assertions/list_union/listunion18_1.xml; String schemapath = fDataDir+/assertions/list_union/listunion18.xsd; try { Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath)); @@ -2780,4 +2780,50 @@ public class AssertionTests extends Xerc
svn commit: r1429247 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XMLAssertPsychopathXPath2Impl.java XMLSchemaValidator.java XSDAssertionValidator.java assertion/XSAsse
Author: mukulg Date: Sat Jan 5 10:43:18 2013 New Revision: 1429247 URL: http://svn.apache.org/viewvc?rev=1429247view=rev Log: schema 1.1 commit: when an attribute's simpleType has assertions and the type is a union of an atomic type and a list, the assertion context variable $value needs to have a relevant typed value. this commit provides few improvements related to this. there are also few minor refactorings and javadoc improvements. Added: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertConstants.java (with props) Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1429247r1=1429246r2=1429247view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Sat Jan 5 10:43:18 2013 @@ -34,6 +34,7 @@ import org.apache.xerces.impl.dv.XSSimpl import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; import org.apache.xerces.impl.xs.assertion.XMLAssertAdapter; import org.apache.xerces.impl.xs.assertion.XSAssert; +import org.apache.xerces.impl.xs.assertion.XSAssertConstants; import org.apache.xerces.impl.xs.assertion.XSAssertImpl; import org.apache.xerces.impl.xs.util.ObjectListImpl; import org.apache.xerces.impl.xs.util.XS11TypeHelper; @@ -163,7 +164,7 @@ public class XMLAssertPsychopathXPath2Im } // if we have assertions applicable to this element, store the element reference and the assertions on it on the runtime stacks -List assertionList = (List) augs.getItem(ASSERT); +List assertionList = (List) augs.getItem(XSAssertConstants.assertList); if (assertionList != null) { fAssertRootStack.push(fCurrentAssertDomNode); fAssertListStack.push(assertionList); @@ -172,7 +173,7 @@ public class XMLAssertPsychopathXPath2Im // evaluate assertions from attributes. evaluation of assertions on attributes in startElement call, helps us setting the PSVI results // for attributes appropriately. -if (((Boolean)augs.getItem(ATTRIBUTES-HAVE-ASSERTS)).booleanValue()) { +if (((Boolean)augs.getItem(XSAssertConstants.isAttrHaveAsserts)).booleanValue()) { evaluateAssertsFromAttributes(element, attributes); } @@ -389,18 +390,18 @@ public class XMLAssertPsychopathXPath2Im // evaluating assertions for simpleType - list evaluateAssertionOnSTListValue(element, value, assertImpl, false, simpleTypeDefn.getItemType(), isTypeDerivedFromList); } -else if (((Boolean)augs.getItem(ASSERT_PROC_NEEDED_FOR_UNION)).booleanValue()) { -// evaluating assertions for simpleType - union -boolean isValueValidWithSTUnion = evaluateAssertionOnSTUnion(element, simpleTypeDefn, isTypeDerivedFromUnion, assertImpl, value, augs); -if (!isValueValidWithSTUnion) { -if (isAttribute) { - fXmlSchemaValidator.reportSchemaError(cvc-attribute.3, new Object[] {element.rawname, attrQname.localpart, value, ((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()}); -} -else { -fXmlSchemaValidator.reportSchemaError(cvc-type.3.1.3, new Object[] {element.rawname, value}); -} +else if (!isAttribute ((Boolean)augs.getItem(XSAssertConstants.isAssertProcNeededForUnionElem)).booleanValue()) { +// evaluating assertions for simpleType - union for an element +if (!evaluateAssertionOnSTUnion(element, simpleTypeDefn, isTypeDerivedFromUnion, assertImpl, value, augs)) { +fXmlSchemaValidator.reportSchemaError(cvc-type.3.1.3, new Object[] {element.rawname, value}); } } +else if (isAttribute ((Boolean)augs.getItem(XSAssertConstants.isAssertProcNeededForUnionAttr)).booleanValue()) { +// evaluating assertions for simpleType - union for an attribute +if (!evaluateAssertionOnSTUnion(element, simpleTypeDefn, isTypeDerivedFromUnion, assertImpl, value, augs
svn commit: r1429469 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java
Author: mukulg Date: Sun Jan 6 06:19:26 2013 New Revision: 1429469 URL: http://svn.apache.org/viewvc?rev=1429469view=rev Log: schema 1.1 commit: committing a minor improvement to assertions implementation. this handles better the case, when assertions are within a simpleType-union scenario (particularly, when a memberType of union in non XSD namespace having non-assertion facets can validate successfully an XML instance value). Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1429469r1=1429468r2=1429469view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Sun Jan 6 06:19:26 2013 @@ -618,65 +618,58 @@ public class XMLAssertPsychopathXPath2Im private boolean isValidationFailedForSTUnion(XSObjectList memberTypes, QName element, String value, Augmentations augs) { boolean isValidationFailedForUnion = true; -final int memberTypesLength = memberTypes.getLength(); -int memberTypesHavingAsserts = 0; - -for (int memberTypeIdx = 0; memberTypeIdx memberTypesLength; memberTypeIdx++) { + +for (int memberTypeIdx = 0; memberTypeIdx memberTypes.getLength(); memberTypeIdx++) { XSSimpleTypeDefinition memType = (XSSimpleTypeDefinition) memberTypes.item(memberTypeIdx); -// check for assertions on types in an non-schema namespace -if (!SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(memType.getNamespace()) XS11TypeHelper.simpleTypeHasAsserts(memType)) { -memberTypesHavingAsserts++; -XSObjectList memberTypeFacets = memType.getMultiValueFacets(); -final int memberTypeFacetsLength = memberTypeFacets.getLength(); -for (int memberTypeFacetIdx = 0; memberTypeFacetIdx memberTypeFacetsLength; memberTypeFacetIdx++) { -XSMultiValueFacet facet = (XSMultiValueFacet) memberTypeFacets.item(memberTypeFacetIdx); -if (facet.getFacetKind() == XSSimpleTypeDefinition.FACET_ASSERT) { -Vector assertFacets = facet.getAsserts(); -int assertsSucceeded = 0; -for (Iterator iter = assertFacets.iterator(); iter.hasNext(); ) { -XSAssertImpl assertImpl = (XSAssertImpl) iter.next(); -try { - setXDMTypedValueOf$value(fCurrentAssertDomNode, value, memType, null, false, fXpath2DynamicContext); - AssertionError assertError = evaluateOneAssertion(element, assertImpl, value, false, false); - if (assertError == null) { - assertsSucceeded++; - } -} -catch(Exception ex) { - // An exception may occur if for example a typed value cannot be constructed by PsychoPath - // XPath engine for a given string value (say a value '5' was attempted to be converted to a typed - // value xs:date). - // it's useful to report warning ... REVISIT -} -} -if (assertsSucceeded == assertFacets.size()) { -// all assertions on a 'union' member type have evaluated to 'true', therefore validation with -// union has succeeded wrt assertions. -// update memberType PSVI property -ItemPSVI elemPSVI = (ItemPSVI)augs.getItem(Constants.ELEMENT_PSVI); -ItemPSVI attrPSVI = (ItemPSVI)augs.getItem(Constants.ATTRIBUTE_PSVI); -if (elemPSVI != null) { - ((ElementPSVImpl) elemPSVI).fValue.memberType = (XSSimpleType) memType; +if (!SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(memType.getNamespace())) { +// only look for member types in non XSD namespace +if (!XS11TypeHelper.simpleTypeHasAsserts(memType) XS11TypeHelper.isStrValueValidForASimpleType(value, (XSSimpleType)memType, Constants.SCHEMA_VERSION_1_1)) { +isValidationFailedForUnion = false; +break
svn commit: r1429470 - in /xerces/java/branches/xs-1.1-tests: data/assertions/list_union/listunion18.xml data/assertions/list_union/listunion18.xsd src/org/apache/xerces/tests/AssertionTests.java
Author: mukulg Date: Sun Jan 6 06:21:31 2013 New Revision: 1429470 URL: http://svn.apache.org/viewvc?rev=1429470view=rev Log: schema 1.1 commit: adding a new test case for implementation improvements committed few minutes ago. Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xsd Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml?rev=1429470view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml Sun Jan 6 06:21:31 2013 @@ -0,0 +1 @@ +Xabcde/X \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xsd?rev=1429470view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xsd Sun Jan 6 06:21:31 2013 @@ -0,0 +1,27 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; + +xs:element name=X + xs:simpleType + xs:union memberTypes=T1 T2 T3/ + /xs:simpleType + /xs:element + + xs:simpleType name=T1 + xs:restriction base=xs:integer + xs:assertion test=($value mod 2) = 0/ + /xs:restriction + /xs:simpleType + + xs:simpleType name=T2 + xs:restriction base=xs:date + xs:assertion test=$value lt current-date()/ + /xs:restriction + /xs:simpleType + + xs:simpleType name=T3 + xs:restriction base=xs:string + xs:length value=5/ + /xs:restriction + /xs:simpleType + +/xs:schema \ 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=1429470r1=1429469r2=1429470view=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 Sun Jan 6 06:21:31 2013 @@ -2764,4 +2764,20 @@ public class AssertionTests extends Xerc } } + public void testAssert155() { + String xmlfile = fDataDir+/assertions/list_union/listunion18.xml; + String schemapath = fDataDir+/assertions/list_union/listunion18.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); + } + } + } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1428373 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XMLSchemaValidator.java util/XS11TypeHelper.java
Author: mukulg Date: Thu Jan 3 14:53:36 2013 New Revision: 1428373 URL: http://svn.apache.org/viewvc?rev=1428373view=rev Log: schema 1.1 commit: committing a minor fix to produce non null strings for XSD type names in error messages, when xsi:type attribute is used. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1428373r1=1428372r2=1428373view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Thu Jan 3 14:53:36 2013 @@ -3220,7 +3220,7 @@ public class XMLSchemaValidator if (!fXSConstraints.checkTypeDerivationOk(type, fCurrentType, block)) { reportSchemaError( cvc-elt.4.3, -new Object[] { element.rawname, xsiType, fCurrentType.getName()}); +new Object[] { element.rawname, xsiType, XS11TypeHelper.getSchemaTypeName(fCurrentType)}); } } @@ -3295,7 +3295,7 @@ public class XMLSchemaValidator } if (!fXSConstraints.checkTypeDerivationOk(type, fCurrentType, block)) { errorList.add(cvc-elt.4.3); -errorList.add(new Object[] { element.rawname, xsiType, fCurrentType.getName()}); +errorList.add(new Object[] { element.rawname, xsiType, XS11TypeHelper.getSchemaTypeName(fCurrentType)}); } } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java?rev=1428373r1=1428372r2=1428373view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java Thu Jan 3 14:53:36 2013 @@ -266,8 +266,8 @@ public class XS11TypeHelper { /* - * Get string value of type name of an XML Schema type definition. This method is useful if XML Schema validator specific names, - * of anonymous types are also needed. + * Get name of an XSD type definition as a string value (which will typically be the value of name attribute of a + * type definition, or an internal name determined by the validator for anonymous types). */ public static String getSchemaTypeName(XSTypeDefinition typeDefn) { - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1428379 - in /xerces/java/trunk/src/org/apache/xerces/impl/xs: XMLSchemaValidator.java util/XS10TypeHelper.java
Author: mukulg Date: Thu Jan 3 14:55:20 2013 New Revision: 1428379 URL: http://svn.apache.org/viewvc?rev=1428379view=rev Log: schema 1.0 commit: committing a minor fix to produce non null strings for XSD type names in error messages, when xsi:type attribute is used. Added: xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XS10TypeHelper.java (with props) Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1428379r1=1428378r2=1428379view=diff == --- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Thu Jan 3 14:55:20 2013 @@ -51,6 +51,7 @@ import org.apache.xerces.impl.xs.identit import org.apache.xerces.impl.xs.models.CMBuilder; import org.apache.xerces.impl.xs.models.CMNodeFactory; import org.apache.xerces.impl.xs.models.XSCMValidator; +import org.apache.xerces.impl.xs.util.XS10TypeHelper; import org.apache.xerces.util.AugmentationsImpl; import org.apache.xerces.util.IntStack; import org.apache.xerces.util.SymbolTable; @@ -2850,7 +2851,7 @@ public class XMLSchemaValidator if (!XSConstraints.checkTypeDerivationOk(type, fCurrentType, block)) { reportSchemaError( cvc-elt.4.3, -new Object[] { element.rawname, xsiType, fCurrentType.getName()}); +new Object[] { element.rawname, xsiType, XS10TypeHelper.getSchemaTypeName(fCurrentType)}); } } Added: xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XS10TypeHelper.java URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XS10TypeHelper.java?rev=1428379view=auto == --- xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XS10TypeHelper.java (added) +++ xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XS10TypeHelper.java Thu Jan 3 14:55:20 2013 @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.xerces.impl.xs.util; + +import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; +import org.apache.xerces.impl.xs.XSComplexTypeDecl; +import org.apache.xerces.xs.XSSimpleTypeDefinition; +import org.apache.xerces.xs.XSTypeDefinition; + +/** + * Class defining utility/helper methods to support XML Schema 1.0 implementation. + * + * @xerces.internal + * + * @author Mukul Gandhi, IBM + * @version $Id$ + */ +public class XS10TypeHelper { + +/* + * Class constructor. + */ +private XS10TypeHelper() { + // a private constructor, to prohibit instantiating this class from an outside class/application. + // this is a good practice, since all methods of this class are static. +} + +/* + * Get name of an XSD type definition as a string value (which will typically be the value of name attribute of a + * type definition, or an internal name determined by the validator for anonymous types). + */ +public static String getSchemaTypeName(XSTypeDefinition typeDefn) { + +String typeNameStr = ; +if (typeDefn instanceof XSSimpleTypeDefinition) { +typeNameStr = ((XSSimpleTypeDecl) typeDefn).getTypeName(); +} +else { +typeNameStr = ((XSComplexTypeDecl) typeDefn).getTypeName(); +} + +return typeNameStr; + +} // getSchemaTypeName + + +} // class XS10TypeHelper Propchange: xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XS10TypeHelper.java -- svn:eol-style = native Propchange: xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XS10TypeHelper.java -- svn:keywords = Author Date Id Revision
svn commit: r1427171 - in /xerces/java/branches/xml-schema-1.1-dev: src/org/apache/xerces/impl/xs/ src/org/apache/xerces/impl/xs/assertion/ tools/
Author: mukulg Date: Mon Dec 31 16:41:17 2012 New Revision: 1427171 URL: http://svn.apache.org/viewvc?rev=1427171view=rev Log: schema 1.1 commit: 1) committing few fixes to assertions implementation. assertion xpath2 context variable $value now handles better the case, when it represents a value for simpleType which is a union of an atomic type and a list. 2) a new psychopath xpath2 jar is also provided, with corresponding improvements to computing typed value of a node (the codebase at Eclipse repository was also updated). Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2Value.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1427171r1=1427170r2=1427171view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Mon Dec 31 16:41:17 2012 @@ -466,7 +466,7 @@ public class XMLAssertPsychopathXPath2Im /* * Evaluate assertion on a simpleType with variety xs:union. */ -private boolean evaluateAssertionOnSTUnion(QName element, XSSimpleTypeDefinition simpleTypeDefn, boolean isTypeDerivedFromUnion, XSAssertImpl assertImpl, String value, Augmentations augs) { +private boolean evaluateAssertionOnSTUnion(QName element, XSSimpleTypeDefinition simpleTypeDefn, boolean isTypeDerivedFromUnion, XSAssertImpl assertImpl, String value, Augmentations augs) throws Exception { boolean isValueValid = true; @@ -509,7 +509,7 @@ public class XMLAssertPsychopathXPath2Im if (value != null) { // complex type with simple content restorePsviInfoForXPathContext(elemPsvi); -setXDMTypedValueOf$value(fCurrentAssertDomNode, value, null, null, false, fXpath2DynamicContext); +setXDMValueOf$valueForCTWithSimpleContent(value, (XSComplexTypeDefinition)elemPsvi.getTypeDefinition(), fXpath2DynamicContext); savePsviInfoWithUntypingOfAssertRoot(elemPsvi, true); } else { // complex type with complex content. set xpath context variable $value to an empty sequence. @@ -618,12 +618,13 @@ public class XMLAssertPsychopathXPath2Im boolean isValidationFailedForUnion = true; final int memberTypesLength = memberTypes.getLength(); +int memberTypesHavingAsserts = 0; for (int memberTypeIdx = 0; memberTypeIdx memberTypesLength; memberTypeIdx++) { XSSimpleTypeDefinition memType = (XSSimpleTypeDefinition) memberTypes.item(memberTypeIdx); - // check for assertions on types in an non-schema namespace if (!SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(memType.getNamespace()) XS11TypeHelper.simpleTypeHasAsserts(memType)) { +memberTypesHavingAsserts++; XSObjectList memberTypeFacets = memType.getMultiValueFacets(); final int memberTypeFacetsLength = memberTypeFacets.getLength(); for (int memberTypeFacetIdx = 0; memberTypeFacetIdx memberTypeFacetsLength; memberTypeFacetIdx++) { @@ -659,13 +660,22 @@ public class XMLAssertPsychopathXPath2Im else { ((AttributePSVImpl) attrPSVI).fValue.memberType = (XSSimpleType) memType; } -return false; +isValidationFailedForUnion = false; +break; } } } +if (!isValidationFailedForUnion) { +break; +} } } +if (memberTypesHavingAsserts == 0) { + // none of the member types have asserts. therefore, validation cannot fail due to checks from this method. + isValidationFailedForUnion = false; +} + return isValidationFailedForUnion; } // isValidationFailedForSTUnion Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2Value.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces
svn commit: r1427173 - in /xerces/java/branches/xs-1.1-tests: data/assertions/list_union/ src/org/apache/xerces/tests/
Author: mukulg Date: Mon Dec 31 16:44:46 2012 New Revision: 1427173 URL: http://svn.apache.org/viewvc?rev=1427173view=rev Log: schema 1.1 commit: committing few new test cases for the implementation improvement done in a commit few minutes ago. Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xsd xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xsd xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_3.xsd xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_4.xsd xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion15_1.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion15_1.xsd xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion15_2.xml Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xml?rev=1427173view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xml Mon Dec 31 16:44:46 2012 @@ -0,0 +1 @@ +X2005-10-09 2007-05-07 2007-05-03/X \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xsd?rev=1427173view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_1.xsd Mon Dec 31 16:44:46 2012 @@ -0,0 +1,20 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; + +xs:element name=X + xs:simpleType + xs:restriction base=union_of_DtList_and_integer +xs:assertion test=$value instance of xs:date+/ +xs:assertion test=count($value) eq 3/ + /xs:restriction + /xs:simpleType + /xs:element + + xs:simpleType name=union_of_DtList_and_integer + xs:union memberTypes=xs:integer + xs:simpleType +xs:list itemType=xs:date/ + /xs:simpleType + /xs:union + /xs:simpleType + +/xs:schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xml?rev=1427173view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xml Mon Dec 31 16:44:46 2012 @@ -0,0 +1 @@ +X100/X \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xsd?rev=1427173view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_2.xsd Mon Dec 31 16:44:46 2012 @@ -0,0 +1,19 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; + +xs:element name=X + xs:simpleType + xs:restriction base=union_of_DtList_and_integer +xs:assertion test=$value instance of xs:integer/ + /xs:restriction + /xs:simpleType + /xs:element + + xs:simpleType name=union_of_DtList_and_integer + xs:union memberTypes=xs:integer + xs:simpleType +xs:list itemType=xs:date/ + /xs:simpleType + /xs:union + /xs:simpleType + +/xs:schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_3.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_3.xsd?rev=1427173view=auto == --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion14_3.xsd (added
svn commit: r1426377 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Fri Dec 28 01:37:22 2012 New Revision: 1426377 URL: http://svn.apache.org/viewvc?rev=1426377view=rev Log: committing fix for jira issue, XERCESJ-1599 along with few test cases. Modified: 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/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=1426377r1=1426376r2=1426377view=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 Fri Dec 28 01:37:22 2012 @@ -391,6 +391,10 @@ public class XSDHandler { // objects that correspond to the documents being redefined. private Hashtable fRedefine2XSDMap = new Hashtable(); +// map between a schema document and the schema documents it is overriding. +// schema documents are represented by XSDocumentInfo objects. +private Hashtable fOverrideDependencyMap = new Hashtable(); + // map between redefine elements and the namespace support private Hashtable fRedefine2NSSupport = new Hashtable(); @@ -997,6 +1001,7 @@ public class XSDHandler { fDoc2XSDocumentMap.put(schemaRoot, currSchemaInfo); Vector dependencies = new Vector(); +Vector overrideDependencies = new Vector(); Element rootNode = schemaRoot; Element newSchemaRoot = null; @@ -1271,6 +1276,10 @@ public class XSDHandler { // rename the right things later! fRedefine2XSDMap.put(child, newSchemaInfo); } +if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1 localName.equals(SchemaSymbols.ELT_OVERRIDE) newSchemaInfo != null) { +// record this override dependency +overrideDependencies.addElement(newSchemaInfo); +} if (newSchemaRoot != null) { if (newSchemaInfo != null) dependencies.addElement(newSchemaInfo); @@ -1278,6 +1287,9 @@ public class XSDHandler { } } +if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { + fOverrideDependencyMap.put(currSchemaInfo, overrideDependencies); +} fDependencyMap.put(currSchemaInfo, dependencies); return currSchemaInfo; } // end constructTrees @@ -3955,6 +3967,20 @@ public class XSDHandler { //XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getRoot(DOMUtil.getDocument(currElem))); XSDocumentInfo currSchema = fLocalElementDecl_schema[i]; SchemaGrammar currGrammar = fGrammarBucket.getGrammar(currSchema.fTargetNamespace); +XSDocumentInfo overridingSchema = getOverridingSchemaDocument(currSchema); +if (overridingSchema != null) { +// if this schema was overriden, augment the namespace bindings of the current schema with +// namespace bindings from the overriding schema. REVISIT: doesn't prohibit namespace bindings of +// current schema being used. +SchemaNamespaceSupport namespaceSupport = overridingSchema.fNamespaceSupport; +Enumeration prefixes = namespaceSupport.getAllPrefixes(); +while (prefixes.hasMoreElements()) { +String prefix = (String)prefixes.nextElement(); +if (!(currSchema.fNamespaceSupport.containsPrefix(prefix))) { +currSchema.fNamespaceSupport.declarePrefix(prefix, namespaceSupport.getURI(prefix)); +} +} +} fElementTraverser.traverseLocal (fParticle[i], currElem, currSchema, currGrammar, fAllContext[i], fParent[i], fLocalElemNamespaceContext[i]); // If it's an empty particle, remove it from the containing component. if (fParticle[i].fType == XSParticleDecl.PARTICLE_EMPTY) { @@ -3971,8 +3997,30 @@ public class XSDHandler { removeParticle(group, fParticle[i]); } } -} +} +/* + * Find if the current schema document is overridden by another schema document. If yes, then + * return the overriding schema document. + */ +private XSDocumentInfo getOverridingSchemaDocument(XSDocumentInfo currSchema) { + +XSDocumentInfo schemaDoc = null; + +Enumeration overridingSchemas = fOverrideDependencyMap.keys(); +while (overridingSchemas.hasMoreElements()) { +XSDocumentInfo overridingSchema = (XSDocumentInfo
svn commit: r1426378 - in /xerces/java/branches/xs-1.1-tests: data/jira_bugs/1599_1.xsd data/jira_bugs/1599_2.xsd data/jira_bugs/1599_3.xsd data/jira_bugs/1599_override.xsd src/org/apache/xerces/tests
Author: mukulg Date: Fri Dec 28 01:37:53 2012 New Revision: 1426378 URL: http://svn.apache.org/viewvc?rev=1426378view=rev Log: committing fix for jira issue, XERCESJ-1599 along with few test cases. Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_1.xsd xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_2.xsd xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_3.xsd xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_override.xsd Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_1.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_1.xsd?rev=1426378view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_1.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_1.xsd Fri Dec 28 01:37:53 2012 @@ -0,0 +1,15 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=schemaNS xmlns:ns=schemaNS +xs:override schemaLocation=1599_override.xsd +xs:element name=person +xs:complexType +xs:sequence +xs:element name=name/ +xs:element name=email/ +xs:element ref=ns:link/ +/xs:sequence +/xs:complexType +/xs:element +/xs:override + +xs:element name=link/ +/xs:schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_2.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_2.xsd?rev=1426378view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_2.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_2.xsd Fri Dec 28 01:37:53 2012 @@ -0,0 +1,15 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=schemaNS +xs:override schemaLocation=1599_override.xsd +xs:element name=person +xs:complexType +xs:sequence +xs:element name=name/ +xs:element name=email/ +xs:element ref=ns:link xmlns:ns=schemaNS/ +/xs:sequence +/xs:complexType +/xs:element +/xs:override + +xs:element name=link/ +/xs:schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_3.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_3.xsd?rev=1426378view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_3.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_3.xsd Fri Dec 28 01:37:53 2012 @@ -0,0 +1,15 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=schemaNS +xs:override schemaLocation=1599_override.xsd +xs:element name=person xmlns:ns=schemaNS +xs:complexType +xs:sequence +xs:element name=name/ +xs:element name=email/ +xs:element ref=ns:link/ +/xs:sequence +/xs:complexType +/xs:element +/xs:override + +xs:element name=link/ +/xs:schema \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_override.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_override.xsd?rev=1426378view=auto == --- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_override.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1599_override.xsd Fri Dec 28 01:37:53 2012 @@ -0,0 +1,11 @@ +?xml version=1.0 encoding=UTF-8? +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=schemaNS +xs:element name=person +xs:complexType +xs:sequence +xs:element name=name/ +xs:element name=email/ +/xs:sequence +/xs:complexType +/xs:element +/xs:schema \ No newline at end of file Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java?rev=1426378r1=1426377r2=1426378view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java Fri Dec 28 01:37:53 2012 @@ -312,5 +312,41 @@ public class JiraBugsTests extends Xerce assertTrue(false
svn commit: r1422485 - /xerces/java/branches/xs-1.1-tests/
Author: mukulg Date: Sun Dec 16 08:44:11 2012 New Revision: 1422485 URL: http://svn.apache.org/viewvc?rev=1422485view=rev Log: adding a folder xs-1.1-tests for copying a unit test suite, related to XML Schema 1.1 functionality. Added: xerces/java/branches/xs-1.1-tests/ - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1422490 [10/13] - in /xerces/java/branches/xs-1.1-tests: ./ data/ data/assertions/ data/assertions/ST/ data/assertions/ST/list/ data/assertions/attributes/ data/assertions/defaultValues/
Added: xerces/java/branches/xs-1.1-tests/data/version-control/test49.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/version-control/test49.xsd?rev=1422490view=auto == --- xerces/java/branches/xs-1.1-tests/data/version-control/test49.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/version-control/test49.xsd Sun Dec 16 09:12:49 2012 @@ -0,0 +1,46 @@ +?xml version='1.0'? +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; + xmlns:vc=http://www.w3.org/2007/XMLSchema-versioning; + +xs:element name=TEST + xs:complexType + xs:sequence +xs:element name=X type=EMPTY/ +xs:element name=Y type=EMPTY vc:minVersion=1.0 vc:maxVersion=1.1 + xs:annotation + xs:documentation + This element declaration is available to XML Schema engine only in XSD 1.0 mode. + /xs:documentation + /xs:annotation +/xs:element +xs:element name=Y type=EMPTY_11 vc:minVersion=1.1 + xs:annotation + xs:documentation + This element declaration is available to XML Schema engine only in XSD 1.1 + (and future versions) mode. + /xs:documentation + /xs:annotation +/xs:element +xs:element name=Z type=union_of_EMPTY_and_INTEGER/ +xs:element name=U type=union_of_EMPTY_and_INTEGER/ + /xs:sequence + /xs:complexType + /xs:element + + xs:simpleType name=EMPTY + xs:restriction base=xs:string + xs:maxLength value=0/ + /xs:restriction + /xs:simpleType + + xs:simpleType name=EMPTY_11 vc:minVersion=1.1 xmlns:xerces=http://xerces.apache.org; + xs:restriction base=xs:string + xs:assertion test=$value = '' xerces:message=An simple schema type defines the content to be EMPTY/ + /xs:restriction + /xs:simpleType + + xs:simpleType name=union_of_EMPTY_and_INTEGER + xs:union memberTypes=EMPTY xs:integer/ + /xs:simpleType + +/xs:schema \ No newline at end of file Propchange: xerces/java/branches/xs-1.1-tests/data/version-control/test49.xsd -- svn:eol-style = native Propchange: xerces/java/branches/xs-1.1-tests/data/version-control/test49.xsd -- svn:keywords = Author Date Id Revision Added: xerces/java/branches/xs-1.1-tests/data/version-control/test5.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/version-control/test5.xsd?rev=1422490view=auto == --- xerces/java/branches/xs-1.1-tests/data/version-control/test5.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/version-control/test5.xsd Sun Dec 16 09:12:49 2012 @@ -0,0 +1,13 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +xs:schema xmlns:vc=http://www.w3.org/2007/XMLSchema-versioning; xmlns:xs=http://www.w3.org/2001/XMLSchema; + + xs:element name=A + xs:complexType + xs:sequence + xs:element name=x type=xs:normalizedString vc:typeUnavailable=xs:string xs:normalizedString/ + xs:element name=y type=xs:string/ + /xs:sequence + /xs:complexType + /xs:element + +/xs:schema Propchange: xerces/java/branches/xs-1.1-tests/data/version-control/test5.xsd -- svn:eol-style = native Propchange: xerces/java/branches/xs-1.1-tests/data/version-control/test5.xsd -- svn:keywords = Author Date Id Revision Added: xerces/java/branches/xs-1.1-tests/data/version-control/test6.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/version-control/test6.xsd?rev=1422490view=auto == --- xerces/java/branches/xs-1.1-tests/data/version-control/test6.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/version-control/test6.xsd Sun Dec 16 09:12:49 2012 @@ -0,0 +1,20 @@ +xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; + xmlns:vc=http://www.w3.org/2007/XMLSchema-versioning; + + xs:element name=A +
svn commit: r1422528 - /xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/
Author: mukulg Date: Sun Dec 16 11:24:54 2012 New Revision: 1422528 URL: http://svn.apache.org/viewvc?rev=1422528view=rev Log: adding class metadata like author name etc to schema 1.1 unit test files Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/ConditionalInclusionTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/FailureMesgFragments.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/GenericTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/OpenContentTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/OverrideTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/PSVIHandler.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/PSVITests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/RedefineTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/SimpleTypeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/SubstitutionGroupTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/TargetNamespaceTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/TypeAlternativeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java?rev=1422528r1=1422527r2=1422528view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java Sun Dec 16 11:24:54 2012 @@ -20,6 +20,12 @@ package org.apache.xerces.tests; import junit.framework.Test; import junit.framework.TestSuite; +/** + * @xerces.internal + * + * @author: Mukul Gandhi IBM + * @version $Id: + */ public class AllXercesXSD11Tests { public static Test suite() { 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=1422528r1=1422527r2=1422528view=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 Sun Dec 16 11:24:54 2012 @@ -24,6 +24,12 @@ import javax.xml.transform.stream.Stream import javax.xml.validation.Schema; import javax.xml.validation.Validator; +/** + * @xerces.internal + * + * @author: Mukul Gandhi IBM + * @version $Id: + */ public class AssertionTests extends XercesAbstractTestCase { public AssertionTests(String name) { Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java?rev=1422528r1=1422527r2=1422528view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java Sun Dec 16 11:24:54 2012 @@ -24,6 +24,12 @@ import javax.xml.transform.stream.Stream import javax.xml.validation.Schema; import javax.xml.validation.Validator; +/** + * @xerces.internal + * + * @author: Mukul Gandhi IBM + * @version $Id: + */ public class AttributeTests extends XercesAbstractTestCase { public AttributeTests(String name) { Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java?rev=1422528r1=1422527r2=1422528view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests
svn commit: r1422534 - /xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/
Author: mukulg Date: Sun Dec 16 11:33:38 2012 New Revision: 1422534 URL: http://svn.apache.org/viewvc?rev=1422534view=rev Log: trying to fix class metadata again. I hope it gets right this time. Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/ConditionalInclusionTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/FailureMesgFragments.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/GenericTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/OpenContentTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/OverrideTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/PSVIHandler.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/PSVITests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/RedefineTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/SimpleTypeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/SubstitutionGroupTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/TargetNamespaceTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/TypeAlternativeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java?rev=1422534r1=1422533r2=1422534view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java Sun Dec 16 11:33:38 2012 @@ -24,7 +24,7 @@ import junit.framework.TestSuite; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id: + * @version $Id */ public class AllXercesXSD11Tests { 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=1422534r1=1422533r2=1422534view=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 Sun Dec 16 11:33:38 2012 @@ -28,7 +28,7 @@ import javax.xml.validation.Validator; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id: + * @version $Id */ public class AssertionTests extends XercesAbstractTestCase { Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java?rev=1422534r1=1422533r2=1422534view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java Sun Dec 16 11:33:38 2012 @@ -28,7 +28,7 @@ import javax.xml.validation.Validator; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id: + * @version $Id */ public class AttributeTests extends XercesAbstractTestCase { Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java?rev=1422534r1=1422533r2=1422534view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java Sun Dec 16 11:33:38 2012 @@ -28,7 +28,7 @@ import javax.xml.validation.Validator; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id: + * @version $Id */ public class CompositorTests extends XercesAbstractTestCase { Modified: xerces/java/branches/xs-1.1-tests/src/org/apache
svn commit: r1422538 - /xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/
Author: mukulg Date: Sun Dec 16 11:41:22 2012 New Revision: 1422538 URL: http://svn.apache.org/viewvc?rev=1422538view=rev Log: trying svn keyword substitution once again. apologies for multiple commits. Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/ConditionalInclusionTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/FailureMesgFragments.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/GenericTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/IDConstraintTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/OpenContentTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/OverrideTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/PSVIHandler.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/PSVITests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/RedefineTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/SimpleTypeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/SubstitutionGroupTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/TargetNamespaceTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/TypeAlternativeTests.java xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java?rev=1422538r1=1422537r2=1422538view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java Sun Dec 16 11:41:22 2012 @@ -24,7 +24,7 @@ import junit.framework.TestSuite; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id + * @version $Id$ */ public class AllXercesXSD11Tests { 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=1422538r1=1422537r2=1422538view=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 Sun Dec 16 11:41:22 2012 @@ -28,7 +28,7 @@ import javax.xml.validation.Validator; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id + * @version $Id$ */ public class AssertionTests extends XercesAbstractTestCase { Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java?rev=1422538r1=1422537r2=1422538view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AttributeTests.java Sun Dec 16 11:41:22 2012 @@ -28,7 +28,7 @@ import javax.xml.validation.Validator; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id + * @version $Id$ */ public class AttributeTests extends XercesAbstractTestCase { Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java?rev=1422538r1=1422537r2=1422538view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/CompositorTests.java Sun Dec 16 11:41:22 2012 @@ -28,7 +28,7 @@ import javax.xml.validation.Validator; * @xerces.internal * * @author: Mukul Gandhi IBM - * @version $Id + * @version $Id$ */ public class CompositorTests extends XercesAbstractTestCase { Modified: xerces/java/branches/xs-1.1-tests/src/org
svn commit: r1422553 - /xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java
Author: mukulg Date: Sun Dec 16 11:54:02 2012 New Revision: 1422553 URL: http://svn.apache.org/viewvc?rev=1422553view=rev Log: doing a minor spelling correction Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java?rev=1422553r1=1422552r2=1422553view=diff == --- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java (original) +++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/XercesAbstractTestCase.java Sun Dec 16 11:54:02 2012 @@ -109,7 +109,7 @@ public class XercesAbstractTestCase exte /* -* Are error messages generated during the validation episode, as per specified in the test case. +* Are error messages generated during the validation episode, as specified in the test case. */ public boolean areErrorMessagesConsistent(List expectedMsgList) { boolean isErrorMesgsOk = true; - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1420674 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Wed Dec 12 13:53:07 2012 New Revision: 1420674 URL: http://svn.apache.org/viewvc?rev=1420674view=rev Log: schema 1.1 commit: committing minor improvements to xpath2 fn:max and fn:min function implementations. now they are able to accept element and attribute node sequences (i.e, now we allow atomization of the input to these functions, as per the rules specified in XPath 2.0 spec). This now allows an assertion like following to work fine, xs:complexType xs:sequence xs:element name=meeting type=xs:date maxOccurs=unbounded/ /xs:sequence xs:assert test=max(meeting) lt current-date()/ /xs:complexType The corresponding changes were also committed to the Eclipse repository. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1420674r1=1420673r2=1420674view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1414220 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Tue Nov 27 15:06:55 2012 New Revision: 1414220 URL: http://svn.apache.org/viewvc?rev=1414220view=rev Log: committing an improved psychopath xpath2 jar. this has improvements to fn:max and fn:min function implementations. the corresponding improvements were also committed to the Eclipse repository. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1414220r1=1414219r2=1414220view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1413712 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Mon Nov 26 16:47:10 2012 New Revision: 1413712 URL: http://svn.apache.org/viewvc?rev=1413712view=rev Log: committing an improved psychopath xpath2 jar. this has following improvements, 1) minor improvements to fn:distinct-values and fn:deep-equal function implementations 2) improvements to comparison 0 = -0 for xs:float and xs:double the corresponding improvements were also committed to the Eclipse repository. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1413712r1=1413711r2=1413712view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1413119 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sat Nov 24 02:52:31 2012 New Revision: 1413119 URL: http://svn.apache.org/viewvc?rev=1413119view=rev Log: committing an improved psychopath xpath2 jar. this has improvement to fn:index-of function implementation. psychopath codebase at Eclipse repository was also updated with these changes. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1413119r1=1413118r2=1413119view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1411312 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Mon Nov 19 17:07:17 2012 New Revision: 1411312 URL: http://svn.apache.org/viewvc?rev=1411312view=rev Log: committing an improvement as suggested in latest comment on jira issue XERCESJ-1594. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1411312r1=1411311r2=1411312view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Mon Nov 19 17:07:17 2012 @@ -2749,13 +2749,13 @@ public class XMLSchemaValidator id.getCategory() == IdentityConstraint.IC_KEYREF) { ValueStoreBase values = fValueStoreCache.getValueStoreFor(id, selMatcher.getInitialDepth()); -// report error if not all fields are present -if (values.fValuesCount != values.fFieldCount) { -reportSchemaError(KeyRefNotEnoughValues, new Object[] { element.rawname, values.getIdentityConstraint().getName() }); -} -if (values != null) {// nothing to do if nothing matched -values.endDocumentFragment(); -} +if (values != null) { +values.endDocumentFragment(); // nothing to do if nothing matched +// report error if not all fields are present +if (values.fValuesCount != values.fFieldCount) { +reportSchemaError(KeyRefNotEnoughValues, new Object[] { element.rawname, values.getIdentityConstraint().getName() }); +} +} } } } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1410698 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: msg/XMLSchemaMessages.properties xs/XMLSchemaValidator.java
Author: mukulg Date: Sat Nov 17 05:27:30 2012 New Revision: 1410698 URL: http://svn.apache.org/viewvc?rev=1410698view=rev Log: committing fix for jira issue XERCESJ-1594. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1410698r1=1410697r2=1410698view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Sat Nov 17 05:27:30 2012 @@ -44,6 +44,7 @@ KeyRefOutOfScope = Identity Constraint error: the keyref identity constraint \{0}\ refers to a key or unique that is out of scope. KeyRefReferNotFound = Key reference declaration \{0}\ refers to unknown key with name \{1}\. UnknownField = Internal identity constraint error; unknown field \{0}\ for identity constraint \{2}\ specified for element \{1}\. +KeyRefNotEnoughValues = cvc-identity-constraint.4.3.b: Not enough values specified for keyref name=\{1}\ identity constraint specified for element \{0}\. # Ideally, we should only use the following error keys, not the ones under # Identity constraints. And we should cover all of the following errors. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1410698r1=1410697r2=1410698view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Sat Nov 17 05:27:30 2012 @@ -2749,18 +2749,13 @@ public class XMLSchemaValidator id.getCategory() == IdentityConstraint.IC_KEYREF) { ValueStoreBase values = fValueStoreCache.getValueStoreFor(id, selMatcher.getInitialDepth()); -// nothing to do if nothing matched, or if not all -// fields are present. -if (values != null values.fValuesCount == values.fFieldCount) { -values.endDocumentFragment(); +// report error if not all fields are present +if (values.fValuesCount != values.fFieldCount) { +reportSchemaError(KeyRefNotEnoughValues, new Object[] { element.rawname, values.getIdentityConstraint().getName() }); } -else if (values != null) { -IdentityConstraint idcConstraint = values.getIdentityConstraint(); -if (fValueStoreCache.fGlobalIDConstraintMap.get(((KeyRef)idcConstraint).getKey()) == null) { -reportSchemaError(KeyRefOutOfScope, new Object[] { idcConstraint.getName() }); -} +if (values != null) {// nothing to do if nothing matched +values.endDocumentFragment(); } - } } } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1409237 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Wed Nov 14 15:51:57 2012 New Revision: 1409237 URL: http://svn.apache.org/viewvc?rev=1409237view=rev Log: schema 1.1 commit: committing a new psychopath xpath2 engine jar file. this has few enhancements for XPath 2.0 value comparison operators. previously an expression like 1 eq '1' produced a true result. this now produces a dynamic error XPTY0004 as per the XPath 2.0 spec. the implementation of operators lt and gt were also enhanced similarly. I observed that operators le, ge and ne worked fine previously. I discovered this error, when I was trying to do xpath2 deep-equal(..) on xs:string and xs:integer sequences (a related bug in deep-equal is also now solved, due to these enhancements). PS: the psychopath engine changes were also committed on the Eclipse repository. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1409237r1=1409236r2=1409237view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1407196 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Thu Nov 8 18:08:10 2012 New Revision: 1407196 URL: http://svn.apache.org/viewvc?rev=1407196view=rev Log: schema 1.1 commit: committing a new PsychoPath XPath 2.0 JAR. this has improved implementation of computing typed value of element nodes with element-only content model (please refer to following eclipse bug, https://bugs.eclipse.org/bugs/show_bug.cgi?id=393904). Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1407196r1=1407195r2=1407196view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1396487 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers: XSDComplexTypeTraverser.java XSDSimpleTypeTraverser.java
Author: mukulg Date: Wed Oct 10 07:00:56 2012 New Revision: 1396487 URL: http://svn.apache.org/viewvc?rev=1396487view=rev Log: committing additional fix for jira issue, XERCESJ-1584 (as reported in the latest comment) Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?rev=1396487r1=1396486r2=1396487view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Wed Oct 10 07:00:56 2012 @@ -214,17 +214,15 @@ class XSDComplexTypeTraverser extends X if (complexTypeName == null) { reportSchemaError(s4s-att-must-appear, new Object[]{SchemaSymbols.ELT_COMPLEXTYPE, SchemaSymbols.ATT_NAME}, complexTypeNode); type = null; -} else { - -// XML Schema 1.1 -// If parent of complex type is redefine, then we need to set the -// context of the redefined complex type -if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { -Element parent = DOMUtil.getParent(complexTypeNode); -if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE)) { -((XSComplexTypeDecl)type.getBaseType()).setContext(type); -grammar.addGlobalComplexTypeDecl(type); +} else { +if (DOMUtil.getLocalName(DOMUtil.getParent(complexTypeNode)).equals(SchemaSymbols.ELT_REDEFINE)) { +if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { + // XML Schema 1.1 + // If parent of complex type is redefine, then we need to set the + // context of the redefined complex type + ((XSComplexTypeDecl)type.getBaseType()).setContext(type); } +grammar.addGlobalComplexTypeDecl(type); } if (grammar.getGlobalTypeDecl(type.getName()) == null) { Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java?rev=1396487r1=1396486r2=1396487view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDSimpleTypeTraverser.java Wed Oct 10 07:00:56 2012 @@ -108,22 +108,20 @@ class XSDSimpleTypeTraverser extends XSD } // don't add global components without name to the grammar -if (type != null) { - -// XML Schema 1.1 -// If parent is redefine, then we need to set the -// context of the redefined simple type -if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { -Element parent = DOMUtil.getParent(elmNode); -if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE)) { +if (type != null) { +if (DOMUtil.getLocalName(DOMUtil.getParent(elmNode)).equals(SchemaSymbols.ELT_REDEFINE)) { +if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { +// XML Schema 1.1 +// If parent is redefine, then we need to set the +// context of the redefined simple type final XSTypeDefinition baseType = type.getBaseType(); if (baseType instanceof XSSimpleTypeDecl) { -((XSSimpleTypeDecl)baseType).setContext(type); -grammar.addGlobalSimpleTypeDecl(type); +((XSSimpleTypeDecl)baseType).setContext(type); } } +grammar.addGlobalSimpleTypeDecl(type); } - + if (grammar.getGlobalTypeDecl(type.getName()) == null) { grammar.addGlobalSimpleTypeDecl(type
svn commit: r1396551 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers: XSDAttributeGroupTraverser.java XSDGroupTraverser.java
Author: mukulg Date: Wed Oct 10 11:42:43 2012 New Revision: 1396551 URL: http://svn.apache.org/viewvc?rev=1396551view=rev Log: committing fix for jira issue, XERCESJ-1591 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeGroupTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDGroupTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeGroupTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeGroupTraverser.java?rev=1396551r1=1396550r2=1396551view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeGroupTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAttributeGroupTraverser.java Wed Oct 10 11:42:43 2012 @@ -179,7 +179,8 @@ class XSDAttributeGroupTraverser extends attrGrp.fAnnotations = annotations; // make an entry in global declarations. -if (grammar.getGlobalAttributeGroupDecl(attrGrp.fName) == null) { +if (grammar.getGlobalAttributeGroupDecl(attrGrp.fName) == null || + DOMUtil.getLocalName(DOMUtil.getParent(elmNode)).equals(SchemaSymbols.ELT_REDEFINE)) { grammar.addGlobalAttributeGroupDecl(attrGrp); } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDGroupTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDGroupTraverser.java?rev=1396551r1=1396550r2=1396551view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDGroupTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDGroupTraverser.java Wed Oct 10 11:42:43 2012 @@ -221,8 +221,10 @@ class XSDGroupTraverser extends XSDAbst annotations = XSObjectListImpl.EMPTY_LIST; } group.fAnnotations = annotations; + // Add group declaration to grammar -if (grammar.getGlobalGroupDecl(group.fName) == null) { +if (grammar.getGlobalGroupDecl(group.fName) == null || + DOMUtil.getLocalName(DOMUtil.getParent(elmNode)).equals(SchemaSymbols.ELT_REDEFINE)) { grammar.addGlobalGroupDecl(group); } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1392722 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: msg/XMLSchemaMessages.properties xs/XMLSchemaValidator.java
Author: mukulg Date: Tue Oct 2 03:34:31 2012 New Revision: 1392722 URL: http://svn.apache.org/viewvc?rev=1392722view=rev Log: committing an improvement, as per latest suggestion in bug report XERCESJ-1585 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1392722r1=1392721r2=1392722view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Tue Oct 2 03:34:31 2012 @@ -40,7 +40,8 @@ KeyMatchesNillable = cvc-identity-constraint.4.2.3: Element \{0}\ has the key \{1}\ which matches an element which has nillable set to true. KeyNotEnoughValues = cvc-identity-constraint.4.2.1.b: Not enough values specified for key name=\{1}\ identity constraint specified for element \{0}\. KeyNotFound = cvc-identity-constraint.4.3: Key ''{0}'' with value ''{1}'' not found for identity constraint of element ''{2}''. -KeyRefOutOfScope = Identity Constraint error: identity constraint \{0}\ has a keyref which refers to a key or unique that is out of scope. +## KeyRefOutOfScope = Identity Constraint error: identity constraint \{0}\ has a keyref which refers to a key or unique that is out of scope. +KeyRefOutOfScope = Identity Constraint error: the keyref identity constraint \{0}\ refers to a key or unique that is out of scope. KeyRefReferNotFound = Key reference declaration \{0}\ refers to unknown key with name \{1}\. UnknownField = Internal identity constraint error; unknown field \{0}\ for identity constraint \{2}\ specified for element \{1}\. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1392722r1=1392721r2=1392722view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Tue Oct 2 03:34:31 2012 @@ -2757,7 +2757,7 @@ public class XMLSchemaValidator else if (values != null) { IdentityConstraint idcConstraint = values.getIdentityConstraint(); if (fValueStoreCache.fGlobalIDConstraintMap.get(((KeyRef)idcConstraint).getKey()) == null) { -reportSchemaError(KeyRefOutOfScope, new Object[] { idcConstraint.toString() }); +reportSchemaError(KeyRefOutOfScope, new Object[] { idcConstraint.getName() }); } } @@ -4767,7 +4767,7 @@ public class XMLSchemaValidator if (fKeyValueStore == null) { // report error String code = KeyRefOutOfScope; -String value = fIdentityConstraint.toString(); +String value = fIdentityConstraint.getName(); reportSchemaError(code, new Object[] { value }); return; } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1388740 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Sat Sep 22 06:31:17 2012 New Revision: 1388740 URL: http://svn.apache.org/viewvc?rev=1388740view=rev Log: committing a fix for jira issue, XERCESJ-1585 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1388740r1=1388739r2=1388740view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Sat Sep 22 06:31:17 2012 @@ -2751,8 +2751,16 @@ public class XMLSchemaValidator fValueStoreCache.getValueStoreFor(id, selMatcher.getInitialDepth()); // nothing to do if nothing matched, or if not all // fields are present. -if (values != null values.fValuesCount == values.fFieldCount) +if (values != null values.fValuesCount == values.fFieldCount) { values.endDocumentFragment(); +} +else if (values != null) { +IdentityConstraint idcConstraint = values.getIdentityConstraint(); +if (fValueStoreCache.fGlobalIDConstraintMap.get(((KeyRef)idcConstraint).getKey()) == null) { +reportSchemaError(KeyRefOutOfScope, new Object[] { idcConstraint.toString() }); +} +} + } } } @@ -4638,6 +4646,10 @@ public class XMLSchemaValidator return fItemValueType; } +private IdentityConstraint getIdentityConstraint() { +return fIdentityConstraint; +} + } // class ValueStoreBase /** - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1381986 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java
Author: mukulg Date: Fri Sep 7 12:03:52 2012 New Revision: 1381986 URL: http://svn.apache.org/viewvc?rev=1381986view=rev Log: committing fix for jira issue, XERCESJ-1577 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java?rev=1381986r1=1381985r2=1381986view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSAttributeChecker.java Fri Sep 7 12:03:52 2012 @@ -1611,21 +1611,20 @@ public class XSAttributeChecker { StringTokenizer st = new StringTokenizer(attrVal, \n\t\r); while (st.hasMoreTokens()) { Object avalue = dv.validate(st.nextToken(), schemaDoc.fValidationContext, null); + modifyQNameForChameleonProcessing(schemaDoc, avalue); ((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue); } } else { Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null); +modifyQNameForChameleonProcessing(schemaDoc, avalue); ((Vector)attrValues[ATTIDX_SUBSGROUP]).addElement(avalue); } } else { -Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null); -// kludge to handle chameleon includes/redefines... +Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null); if (oneAttr.dvIndex == DT_QNAME) { -QName qname = (QName)avalue; -if(qname.prefix == XMLSymbols.EMPTY_STRING qname.uri == null schemaDoc.fIsChameleonSchema) -qname.uri = schemaDoc.fTargetNamespace; + modifyQNameForChameleonProcessing(schemaDoc, avalue); } attrValues[oneAttr.valueIndex] = avalue; } @@ -1687,6 +1686,21 @@ public class XSAttributeChecker { return attrValues; } +/* + * If chameleon pre-processing is required, then this method would modify the QName value appropriately. + * + * @param schemaDoc metadata about the schema document + * @param qnameVal validated QName value + * + */ +private void modifyQNameForChameleonProcessing(XSDocumentInfo schemaDoc, Object qnameVal) { +// kludge to handle chameleon includes/redefines... +QName qname = (QName)qnameVal; +if(qname.prefix == XMLSymbols.EMPTY_STRING qname.uri == null schemaDoc.fIsChameleonSchema) { + qname.uri = schemaDoc.fTargetNamespace; +} +} + private Object validate(Object[] attrValues, String attr, String ivalue, int dvIndex, XSDocumentInfo schemaDoc) throws InvalidDatatypeValueException { if (ivalue == null) - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1381242 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Wed Sep 5 16:49:46 2012 New Revision: 1381242 URL: http://svn.apache.org/viewvc?rev=1381242view=rev Log: committing a new fix for jira issue, XERCESJ-1578 Modified: 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/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=1381242r1=1381241r2=1381242view=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 Sep 5 16:49:46 2012 @@ -1214,7 +1214,7 @@ public class XSDHandler { schemaNamespace = currSchemaInfo.fTargetNamespace; if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { if (refType == XSDDescription.CONTEXT_OVERRIDE) { -if (newSchemaRoot != null isValidTargetUriForIncludeOrOverride(schemaSource, locationHint)) { +if (newSchemaRoot != null isValidTargetUriForIncludeOrOverride(schemaId, locationHint)) { final Element transformedSchemaRoot = (Element) fOverrideHandler.transform(schemaId, child, newSchemaRoot); // Either we had a collision where the transformed @@ -1240,7 +1240,7 @@ public class XSDHandler { fOverrideHandler.checkSchemaRoot(schemaId, child, newSchemaRoot); } } -else if (refType == XSDDescription.CONTEXT_INCLUDE !isValidTargetUriForIncludeOrOverride(schemaSource, locationHint)) { +else if (refType == XSDDescription.CONTEXT_INCLUDE !isValidTargetUriForIncludeOrOverride(schemaId, locationHint)) { fLastSchemaWasDuplicate = true; } } @@ -1286,18 +1286,15 @@ public class XSDHandler { * Check if the target URI for include or override is correct. It must not be absent, and it should not point * to the parent schema document. */ -private boolean isValidTargetUriForIncludeOrOverride(XMLInputSource schemaSource, String locationHint) { +private boolean isValidTargetUriForIncludeOrOverride(String schemaId, String locationHint) { boolean isUriValid = true; - try { - String expandedSystemId = XMLEntityManager.expandSystemId(schemaSource.getSystemId(), schemaSource.getBaseSystemId(), false); - String expandedLoctionHint = XMLEntityManager.expandSystemId(locationHint, locationHint, false); - isUriValid = !(.equals(expandedSystemId) || ((expandedLoctionHint != null) ? expandedLoctionHint.equals(expandedSystemId) : true)); + String expandedLoctionHint = XMLEntityManager.expandSystemId(locationHint, fSchemaGrammarDescription.getBaseSystemId(), false); + isUriValid = !(.equals(schemaId) || ((expandedLoctionHint != null) ? expandedLoctionHint.equals(schemaId) : true)); } catch (MalformedURIException ex) { isUriValid = false; } - return isUriValid; } // isValidTargetUriForIncludeOrOverride - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1380272 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Mon Sep 3 15:23:58 2012 New Revision: 1380272 URL: http://svn.apache.org/viewvc?rev=1380272view=rev Log: committing a fix for latest issue reported for Jira issue, XERCESJ-1578. Modified: 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/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=1380272r1=1380271r2=1380272view=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 Mon Sep 3 15:23:58 2012 @@ -861,7 +861,7 @@ public class XSDHandler { // This method does several things: // It constructs an instance of an XSDocumentInfo object using the -// schemaRoot node. Then, for each include, +// schemaRoot node. Then, for each include, override, // redefine, and import children, it attempts to resolve the // requested schema document, initiates a DOM parse, and calls // itself recursively on that document's root. It also records in @@ -1181,7 +1181,6 @@ public class XSDHandler { } // pass the systemId of the current document as the base systemId boolean mustResolve = false; -boolean isOverride = false; refType = XSDDescription.CONTEXT_INCLUDE; if (localName.equals(SchemaSymbols.ELT_REDEFINE)) { mustResolve = nonAnnotationContent(child); @@ -1190,7 +1189,6 @@ public class XSDHandler { else if (localName.equals(SchemaSymbols.ELT_OVERRIDE)){ mustResolve = nonAnnotationContent(child); refType = XSDDescription.CONTEXT_OVERRIDE; -isOverride = true; } fSchemaGrammarDescription.reset(); fSchemaGrammarDescription.setContextType(refType); @@ -1215,30 +1213,35 @@ public class XSDHandler { newSchemaRoot = resolveSchema(schemaSource, fSchemaGrammarDescription, mustResolve, child); schemaNamespace = currSchemaInfo.fTargetNamespace; if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { -if (isOverride newSchemaRoot != null isValidTargetUriForOverride(schemaSource, locationHint)) { -final Element transformedSchemaRoot = (Element) fOverrideHandler.transform(schemaId, child, newSchemaRoot); +if (refType == XSDDescription.CONTEXT_OVERRIDE) { +if (newSchemaRoot != null isValidTargetUriForIncludeOrOverride(schemaSource, locationHint)) { +final Element transformedSchemaRoot = (Element) fOverrideHandler.transform(schemaId, child, newSchemaRoot); + +// Either we had a collision where the transformed +// schema has global components or we hit a +// transformation cycle +if (transformedSchemaRoot == null) { +fLastSchemaWasDuplicate = true; +} +// In case of a collision where the transformed +// schema has no global components, the override +// transformer will return the new transformed +// schema. We need to process that new schema, +// so we set the duplicate schema flag to false -// Either we had a collision where the transformed -// schema has global components or we hit a -// transformation cycle -if (transformedSchemaRoot == null) { -fLastSchemaWasDuplicate = true; -} -// In case of a collision where the transformed -// schema has no global components, the override -// transformer will return the new transformed -// schema. We need to process that new schema, -// so we set the duplicate schema flag to false +else if (fLastSchemaWasDuplicate transformedSchemaRoot != newSchemaRoot) { +fLastSchemaWasDuplicate = false
svn commit: r1378976 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Thu Aug 30 15:04:33 2012 New Revision: 1378976 URL: http://svn.apache.org/viewvc?rev=1378976view=rev Log: committing the fix for recent issue reported for jira issue, XERCESJ-1578. Modified: 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/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=1378976r1=1378975r2=1378976view=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 Thu Aug 30 15:04:33 2012 @@ -1215,7 +1215,7 @@ public class XSDHandler { newSchemaRoot = resolveSchema(schemaSource, fSchemaGrammarDescription, mustResolve, child); schemaNamespace = currSchemaInfo.fTargetNamespace; if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { -if (isOverride newSchemaRoot != null schemaSource.getSystemId() != ) { +if (isOverride newSchemaRoot != null isValidTargetUriForOverride(schemaSource, locationHint)) { final Element transformedSchemaRoot = (Element) fOverrideHandler.transform(schemaId, child, newSchemaRoot); // Either we had a collision where the transformed @@ -1278,6 +1278,14 @@ public class XSDHandler { fDependencyMap.put(currSchemaInfo, dependencies); return currSchemaInfo; } // end constructTrees + +/* + * Check if the target URI for override is correct. It must not be absent, and it should not point to the parent + * schema document (otherwise, this would result in an un-terminating recursion). + */ +private boolean isValidTargetUriForOverride(XMLInputSource schemaSource, String locationHint) { +return schemaSource.getSystemId() != ((locationHint != null) ? (schemaSource.getSystemId() != locationHint) : true); +} private boolean isExistingGrammar(XSDDescription desc, boolean ignoreConflict) { SchemaGrammar sg = fGrammarBucket.getGrammar(desc.getTargetNamespace()); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1377318 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Sat Aug 25 16:27:22 2012 New Revision: 1377318 URL: http://svn.apache.org/viewvc?rev=1377318view=rev Log: committing fix for jira issue, XERCESJ-1578 Modified: 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/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=1377318r1=1377317r2=1377318view=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 Sat Aug 25 16:27:22 2012 @@ -1212,10 +1212,10 @@ public class XSDHandler { // the existing global components boolean alreadyTraversed = (fNamespaceGrowth) ? sg.getDocumentLocations().contains(schemaId) : false; if (!alreadyTraversed) { -newSchemaRoot = resolveSchema(schemaSource, fSchemaGrammarDescription, mustResolve, child); +newSchemaRoot = resolveSchema(schemaSource, fSchemaGrammarDescription, mustResolve, child); schemaNamespace = currSchemaInfo.fTargetNamespace; if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { -if (isOverride newSchemaRoot != null) { +if (isOverride newSchemaRoot != null schemaSource.getSystemId() != ) { final Element transformedSchemaRoot = (Element) fOverrideHandler.transform(schemaId, child, newSchemaRoot); // Either we had a collision where the transformed - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1369297 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java
Author: mukulg Date: Sat Aug 4 11:17:51 2012 New Revision: 1369297 URL: http://svn.apache.org/viewvc?rev=1369297view=rev Log: doing an improvement to one of the schema 1.1 implementation classes. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java?rev=1369297r1=1369296r2=1369297view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java Sat Aug 4 11:17:51 2012 @@ -44,14 +44,23 @@ import org.eclipse.wst.xml.xpath2.proces import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType; /** - * Class defining utility/helper methods related to XML schema types. + * Class defining utility/helper methods to support XML Schema 1.1 implementation. * * @xerces.internal * * @author Mukul Gandhi, IBM * @version $Id$ */ -public class XS11TypeHelper { +public class XS11TypeHelper { + + +/* + * Class constructor. + */ +private XS11TypeHelper() { + // a private constructor, to prohibit instantiating this class from an outside class/application. + // this is a good practice, since all methods of this class are static. +} /* * Checks if the two schema type components are identical. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1367485 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java
Author: mukulg Date: Tue Jul 31 10:55:40 2012 New Revision: 1367485 URL: http://svn.apache.org/viewvc?rev=1367485view=rev Log: committing fix for jira issue, XERCESJ-1575 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java?rev=1367485r1=1367484r2=1367485view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java Tue Jul 31 10:55:40 2012 @@ -1475,26 +1475,28 @@ public class XSDFACM return; } // If base has max=unbounded, then there's enough space for need -if (base.fCountingStates[d[0]].maxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED) { -d[2] += need; -if (b[2] + need base.fCountingStates[d[0]].minOccurs) { -// Avoid setting count bigger than min if max is unbounded. -// It makes no difference. Not exceeding min means fewer -// distinct states, so shorter state-pairs in the list. -b[2] = base.fCountingStates[d[0]].minOccurs; +if (base.fCountingStates[d[0]] != null) { +if (base.fCountingStates[d[0]].maxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED) { +d[2] += need; +if (b[2] + need base.fCountingStates[d[0]].minOccurs) { +// Avoid setting count bigger than min if max is unbounded. +// It makes no difference. Not exceeding min means fewer +// distinct states, so shorter state-pairs in the list. +b[2] = base.fCountingStates[d[0]].minOccurs; +} +else { +b[2] += need; +} } else { +// If base doesn't have sufficient space, lower need +if (need base.fCountingStates[d[0]].maxOccurs - b[2]) { +need = base.fCountingStates[d[0]].maxOccurs - b[2]; +} b[2] += need; +d[2] += need; } } -else { -// If base doesn't have sufficient space, lower need -if (need base.fCountingStates[d[0]].maxOccurs - b[2]) { -need = base.fCountingStates[d[0]].maxOccurs - b[2]; -} -b[2] += need; -d[2] += need; -} } private void optimizeForAllBase(XS11AllCM base, int[] b, int[] d, int need, int indexb) { // Need to have seen an element, to be safe. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1364043 - /xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml
Author: mukulg Date: Sat Jul 21 08:22:53 2012 New Revision: 1364043 URL: http://svn.apache.org/viewvc?rev=1364043view=rev Log: writing few details to the Xerces faq documentation section Modified: xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml Modified: xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml?rev=1364043r1=1364042r2=1364043view=diff == --- xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml (original) +++ xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml Sat Jul 21 08:22:53 2012 @@ -71,6 +71,23 @@ v.validate(instanceDocument); Schema grammar./p /a + /faq + faq title=Using Entities and CDATA Sections +qHow does the XML Schema processor treat entities and CDATA sections?/q +a + pAccording to the XML Infoset the infoset items contributing to the + jump href='http://www.w3.org/TR/xml-infoset/#infoitem.character'[character + information item]/jump are: characters in the document, whether literally, as + a character reference, or within a CDATA section, or within Entity + Reference. The XML Schema specification + requires as a precondition for assessment + an information set as defined in [XML-Infoset] + jump href='http://www.w3.org/TR/xmlschema-1/#infoset'(Appendix D)/jump and thus Xerces might attempt to normalize data in an entity + reference or CDATA section. To preserve character data within entity references and + CDATA sections, + turn off http://apache.org/xml/features/validation/schema/normalized-value feature. + /p +/a /faq faq title=XPath 2.0 support for XML Schema 1.1 validation qHow Xerces-J uses an XPath 2.0 engine for XML Schema 1.1 assertions and CTAs?/q @@ -94,24 +111,31 @@ v.validate(instanceDocument); /note /a /faq - faq title=Using Entities and CDATA Sections -qHow does the XML Schema processor treat entities and CDATA sections?/q -a - pAccording to the XML Infoset the infoset items contributing to the - jump href='http://www.w3.org/TR/xml-infoset/#infoitem.character'[character - information item]/jump are: characters in the document, whether literally, as - a character reference, or within a CDATA section, or within Entity - Reference. The XML Schema specification - requires as a precondition for assessment - an information set as defined in [XML-Infoset] - jump href='http://www.w3.org/TR/xmlschema-1/#infoset'(Appendix D)/jump and thus Xerces might attempt to normalize data in an entity - reference or CDATA section. To preserve character data within entity references and - CDATA sections, - turn off http://apache.org/xml/features/validation/schema/normalized-value feature. - /p -/a + faq title=User defined error messages, for XML Schema 1.1 assertion failures + qHow to specify a user defined error message, when an XML Schema 1.1 assertion returns a 'false' result?/q + a +pBy default when an XSD 1.1 assertion fails, the Xerces XML Schema validator would produce a default error message, +which would say that which element or attribute was not validated successfully by an assertion and the schema type involved +during validation. It is however possible to, specify an user-defined error message for assertion failures. This is done by +specifying an attribute codemessage/code in the XML namespace code'http://xerces.apache.org'/code on an codexs:assert/code or codexs:assertion/code +element in the schema. The value of attribute codemessage/code is the text of user-defined assertion error message, which is produced by +the Xerces XML Schema validator when an assertion fails. +/p +p +In case of use of the XML Schema codexs:assertion/code facet within simple types, if a user defined error message is used, if a user wants +it is further possible to dynamically construct the assertion error message by fetching the value of XPath 2.0 context variable +code$value/code into the assertion error message. Following is an example of such an assertion error message: +codexerces:message=The number {$value} is not divisible by 2/code. With such a specification of assertion error message, +a value from XML instance document is assigned to a variable placeholder code{$value}/code (which is a key word). Therefore at +runtime, an assertion message for this example would be produced as follows, codeThe number 3 is not divisible by 2/code +(the value 3 was assigned to the variable reference code{$value}/code). +/p +note + User-defined error messages for assertion failures
svn commit: r1361337 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Fri Jul 13 18:59:31 2012 New Revision: 1361337 URL: http://svn.apache.org/viewvc?rev=1361337view=rev Log: committing fix for jira issue, XERCESJ-1568 Modified: 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/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=1361337r1=1361336r2=1361337view=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 Fri Jul 13 18:59:31 2012 @@ -1215,7 +1215,7 @@ public class XSDHandler { newSchemaRoot = resolveSchema(schemaSource, fSchemaGrammarDescription, mustResolve, child); schemaNamespace = currSchemaInfo.fTargetNamespace; if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { -if (isOverride) { +if (isOverride newSchemaRoot != null) { final Element transformedSchemaRoot = (Element) fOverrideHandler.transform(schemaId, child, newSchemaRoot); // Either we had a collision where the transformed - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1360925 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
Author: mukulg Date: Thu Jul 12 20:47:00 2012 New Revision: 1360925 URL: http://svn.apache.org/viewvc?rev=1360925view=rev Log: committing a fix for jira issue XERCESJ-1569 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java?rev=1360925r1=1360924r2=1360925view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java Thu Jul 12 20:47:00 2012 @@ -466,7 +466,7 @@ abstract class XSDAbstractTraverser { } } // process 'assertion' facet. introduced in XML Schema 1.1 -else if (facet.equals(SchemaSymbols.ELT_ASSERTION)) { +else if (facet.equals(SchemaSymbols.ELT_ASSERTION) fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { attrs = fAttrChecker.checkAttributes(content, false, schemaDoc); String testStr = (String) attrs[XSAttributeChecker.ATTIDX_XPATH]; String xpathDefaultNamespace = (String) attrs[XSAttributeChecker.ATTIDX_XPATHDEFAULTNS]; - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1360009 - in /xerces/java/branches/xml-schema-1.1-dev: samples/xs/XSSerializer.java src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java
Author: mukulg Date: Wed Jul 11 04:45:17 2012 New Revision: 1360009 URL: http://svn.apache.org/viewvc?rev=1360009view=rev Log: doing minor refactoring and improving javadocs Modified: xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Modified: xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java?rev=1360009r1=1360008r2=1360009view=diff == --- xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java Wed Jul 11 04:45:17 2012 @@ -70,7 +70,7 @@ import org.xml.sax.InputSource; /** * XSModel serialization utility. - * This utility serializes the Xerces XSModel into lexical, XSD syntax. + * This utility serializes the Xerces XSModel instance into lexical, XSD syntax. * * @author Mukul Gandhi, IBM * @version $Id$ @@ -87,7 +87,7 @@ public class XSSerializer { * * An entry point to test this utility. * - * The XSModel could be synthesized by any means (for example, by direct + * The XSModel could be synthesized by various means (for example, by direct * API calls to Xerces Schema API, methods) -- in which case, the method * serialize will be used directly, passing in the XSModel object. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1360009r1=1360008r2=1360009view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Wed Jul 11 04:45:17 2012 @@ -194,8 +194,8 @@ public class XMLAssertPsychopathXPath2Im if (attrSimpleType != null) { List attrAssertList = fXmlSchemaValidator.getAssertionValidator().getAssertsFromSimpleType(attrSimpleType); if (attrAssertList != null) { -boolean isTypeDerivedFromList = ((XSSimpleType) attrSimpleType.getBaseType()).getVariety() == XSSimpleType.VARIETY_LIST; -boolean isTypeDerivedFromUnion = ((XSSimpleType) attrSimpleType.getBaseType()).getVariety() == XSSimpleType.VARIETY_UNION; +boolean isTypeDerivedFromList = isTypeDerivedFromSTList(attrSimpleType); +boolean isTypeDerivedFromUnion = isTypeDerivedFromSTUnion(attrSimpleType); for (int assertIdx = 0; assertIdx attrAssertList.size(); assertIdx++) { XSAssertImpl assertImpl = (XSAssertImpl)attrAssertList.get(assertIdx); assertImpl.setAttrName(attrQname.localpart); @@ -345,8 +345,8 @@ public class XMLAssertPsychopathXPath2Im private void evaluateAssertionsFromASimpleType(QName element, List assertions, String value, Augmentations augs) throws Exception { XSSimpleTypeDefinition simpleTypeDefn = (XSSimpleTypeDefinition) ((ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI)).getTypeDefinition(); -boolean isTypeDerivedFromList = ((XSSimpleType) simpleTypeDefn.getBaseType()).getVariety() == XSSimpleType.VARIETY_LIST; -boolean isTypeDerivedFromUnion = ((XSSimpleType) simpleTypeDefn.getBaseType()).getVariety() == XSSimpleType.VARIETY_UNION; +boolean isTypeDerivedFromList = isTypeDerivedFromSTList(simpleTypeDefn); +boolean isTypeDerivedFromUnion = isTypeDerivedFromSTUnion(simpleTypeDefn); Vector assertList = (Vector) assertions; for (int assertIdx = 0; assertIdx assertList.size(); assertIdx++) { @@ -546,8 +546,8 @@ public class XMLAssertPsychopathXPath2Im // reassign value to simple type instance simpleTypeDefn = (XSSimpleTypeDefinition)complexTypeDef.getBaseType(); } -boolean isTypeDerivedFromList = ((XSSimpleType) simpleTypeDefn.getBaseType()).getVariety() == XSSimpleType.VARIETY_LIST; -boolean isTypeDerivedFromUnion = ((XSSimpleType) simpleTypeDefn.getBaseType()).getVariety() == XSSimpleType.VARIETY_UNION; +boolean isTypeDerivedFromList = isTypeDerivedFromSTList(simpleTypeDefn); +boolean isTypeDerivedFromUnion = isTypeDerivedFromSTUnion(simpleTypeDefn); restorePsviInfoForXPathContext(elemPsvi
svn commit: r1356945 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Tue Jul 3 21:07:23 2012 New Revision: 1356945 URL: http://svn.apache.org/viewvc?rev=1356945view=rev Log: schema 1.1 fix: committing a fix for issue discussed here, http://markmail.org/message/oeq67cywvut5gqjx (in certain cases, errors generated during XML Schema validation were not propagated up the stack). Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1356945r1=1356944r2=1356945view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Tue Jul 3 21:07:23 2012 @@ -53,15 +53,15 @@ import org.apache.xerces.impl.xs.models. import org.apache.xerces.impl.xs.models.CMNodeFactory; import org.apache.xerces.impl.xs.models.XSCMValidator; import org.apache.xerces.impl.xs.util.ObjectListImpl; -import org.apache.xerces.impl.xs.util.XSObjectListImpl; import org.apache.xerces.impl.xs.util.XS11TypeHelper; +import org.apache.xerces.impl.xs.util.XSObjectListImpl; import org.apache.xerces.util.AugmentationsImpl; import org.apache.xerces.util.IntStack; import org.apache.xerces.util.SymbolTable; +import org.apache.xerces.util.URI.MalformedURIException; import org.apache.xerces.util.XMLAttributesImpl; import org.apache.xerces.util.XMLChar; import org.apache.xerces.util.XMLSymbols; -import org.apache.xerces.util.URI.MalformedURIException; import org.apache.xerces.xni.Augmentations; import org.apache.xerces.xni.NamespaceContext; import org.apache.xerces.xni.QName; @@ -80,6 +80,7 @@ import org.apache.xerces.xni.parser.XMLD import org.apache.xerces.xni.parser.XMLDocumentSource; import org.apache.xerces.xni.parser.XMLEntityResolver; import org.apache.xerces.xni.parser.XMLInputSource; +import org.apache.xerces.xni.parser.XMLParseException; import org.apache.xerces.xs.AttributePSVI; import org.apache.xerces.xs.ElementPSVI; import org.apache.xerces.xs.ShortList; @@ -2620,7 +2621,7 @@ public class XMLSchemaValidator fAssertionValidator.handleStartElement(element, attributes); } catch(Exception ex) { -throw new XNIException(ex.getMessage(), ex); +throw new XMLParseException(fLocator, ex.getMessage()); } } // assertionValidatorStartElementDelegate @@ -2763,7 +2764,7 @@ public class XMLSchemaValidator assertionValidatorEndElementDelegate(element); } catch(Exception ex) { - // NO OP + throw new XMLParseException(fLocator, ex.getMessage()); } } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1350884 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sat Jun 16 08:34:02 2012 New Revision: 1350884 URL: http://svn.apache.org/viewvc?rev=1350884view=rev Log: schema 1.1 commit: fixes to PsychoPath XPath2 engine codebase, for xs:dateTime casts on node reference. here's an email thread which describes the context of this issue, http://markmail.org/message/ov5jyue4rdqwjeri. the corresponding commit was also made at PsychoPath engine's eclipse codebase. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1350884r1=1350883r2=1350884view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1350903 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sat Jun 16 10:11:46 2012 New Revision: 1350903 URL: http://svn.apache.org/viewvc?rev=1350903view=rev Log: doing few minor corrections to the previous commit, related to casts of xs:dateTime to node references Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1350903r1=1350902r2=1350903view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1350861 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java
Author: mukulg Date: Sat Jun 16 04:47:51 2012 New Revision: 1350861 URL: http://svn.apache.org/viewvc?rev=1350861view=rev Log: committing fix for Jira issue, XERCESJ-1559 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java?rev=1350861r1=1350860r2=1350861view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java Sat Jun 16 04:47:51 2012 @@ -30,7 +30,6 @@ import org.apache.xerces.util.XMLChar; import org.apache.xerces.xs.ElementPSVI; import org.apache.xerces.xs.XSComplexTypeDefinition; import org.apache.xerces.xs.XSConstants; -import org.apache.xerces.xs.XSElementDeclaration; import org.apache.xerces.xs.XSObjectList; import org.apache.xerces.xs.XSSimpleTypeDefinition; import org.apache.xerces.xs.XSTypeDefinition; @@ -45,7 +44,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** - * This class defines a set of methods to work with XPath 2.0 dynamic context variable $value that is needed for assertions evaluation. + * This class defines a set of methods to work with XPath 2.0 dynamic context + * variable $value, that is needed for assertions evaluation. * * @xerces.internal * @@ -82,9 +82,8 @@ public class XSAssertionXPath2ValueImpl String strValueOf$value = ; if (textChildCount == effectiveChildNodeCount) { -// the DOM tree we are inspecting has simple content. therefore we can find the desired string value. -XSElementDeclaration elemDecl = pElemPSVI.getElementDeclaration(); -if ((elemDecl.getTypeDefinition()).derivedFrom(SchemaSymbols.URI_SCHEMAFORSCHEMA, SchemaSymbols.ATTVAL_STRING, XSConstants.DERIVATION_RESTRICTION)) { +// the DOM tree we are inspecting has simple content. therefore we can find the desired string value. +if ((pElemPSVI.getTypeDefinition()).derivedFrom(SchemaSymbols.URI_SCHEMAFORSCHEMA, SchemaSymbols.ATTVAL_STRING, XSConstants.DERIVATION_RESTRICTION)) { // if element's schema type is derived by restriction from xs:string, white-space normalization is not needed for the // string value for context variable $value. strValueOf$value = textValueContents.toString(); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1342425 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Thu May 24 20:33:40 2012 New Revision: 1342425 URL: http://svn.apache.org/viewvc?rev=1342425view=rev Log: related to commit for jira issue XERCESJ-1562, doing additional improvements related to {xs:dateTime - xs:dayTimeDuration} subtraction operations with the PsychoPath XPath2 engine. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1342425r1=1342424r2=1342425view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1341644 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Tue May 22 21:31:36 2012 New Revision: 1341644 URL: http://svn.apache.org/viewvc?rev=1341644view=rev Log: committing a slight additional fix to PsychoPath XPath engine, related to the earlier fix committed few minutes ago. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1341644r1=1341643r2=1341644view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1333216 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Wed May 2 21:24:36 2012 New Revision: 1333216 URL: http://svn.apache.org/viewvc?rev=1333216view=rev Log: reversing previous changes, as per new comments for jira issue XERCESJ-1559 Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1333216r1=1333215r2=1333216view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Wed May 2 21:24:36 2012 @@ -2294,14 +2294,6 @@ public class XMLSchemaValidator final boolean isSchema11 = (fSchemaVersion == Constants.SCHEMA_VERSION_1_1); boolean needToPushErrorContext = false; -if (fCurrentType == null xsiType != null fElementDepth == 0) { -fXSIErrorReporter.fErrorReporter.reportError( -XSMessageFormatter.SCHEMA_DOMAIN, -cvc-elt.1.a, -new Object[] { element.rawname }, -XMLErrorReporter.SEVERITY_ERROR); -} - if (fCurrentType == null xsiType == null) { // if this is the validation root, report an error, because // we can't find eith decl or type for this element - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1328734 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Sat Apr 21 20:47:17 2012 New Revision: 1328734 URL: http://svn.apache.org/viewvc?rev=1328734view=rev Log: committing fixes for the bug reported by Jorge Williams, with Xerces's XSD implementation (bug reference, http://markmail.org/message/ijlswam4n6jzb7zh). this bug appears to occur both with Xerces's XSD 1.1 and 1.0 implementations. this also appears to be not XSD 1.1 assertion specific, and appears to be related to use of xsi:type and an schema element declaration not existing for the root XML element. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1328734r1=1328733r2=1328734view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Sat Apr 21 20:47:17 2012 @@ -2293,6 +2293,15 @@ public class XMLSchemaValidator // if no decl/type found for the current element final boolean isSchema11 = (fSchemaVersion == Constants.SCHEMA_VERSION_1_1); boolean needToPushErrorContext = false; + +if (fCurrentType == null xsiType != null fElementDepth == 0) { +fXSIErrorReporter.fErrorReporter.reportError( +XSMessageFormatter.SCHEMA_DOMAIN, +cvc-elt.1.a, +new Object[] { element.rawname }, +XMLErrorReporter.SEVERITY_ERROR); +} + if (fCurrentType == null xsiType == null) { // if this is the validation root, report an error, because // we can't find eith decl or type for this element @@ -2339,7 +2348,8 @@ public class XMLSchemaValidator else if (wildcard != null wildcard.fProcessContents == XSWildcardDecl.PC_STRICT) { // report error, because wilcard = strict reportSchemaError(cvc-complex-type.2.4.c, new Object[] { element.rawname }); -} +} + // no element decl or type found for this element. // Allowed by the spec, we can choose to either laxly assess this // element, or to skip it. Now we choose lax assessment. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1328735 - /xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Sat Apr 21 20:49:58 2012 New Revision: 1328735 URL: http://svn.apache.org/viewvc?rev=1328735view=rev Log: committing the same fix on trunk, for the commit that was made a moment ago on the schema-dev-1.1 branch. Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1328735r1=1328734r2=1328735view=diff == --- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Sat Apr 21 20:49:58 2012 @@ -2106,6 +2106,14 @@ public class XMLSchemaValidator xsiType = attributes.getValue(SchemaSymbols.URI_XSI, SchemaSymbols.XSI_TYPE); } +if (fCurrentType == null xsiType != null fElementDepth == 0) { +fXSIErrorReporter.fErrorReporter.reportError( +XSMessageFormatter.SCHEMA_DOMAIN, +cvc-elt.1.a, +new Object[] { element.rawname }, +XMLErrorReporter.SEVERITY_ERROR); +} + // if no decl/type found for the current element if (fCurrentType == null xsiType == null) { // if this is the validation root, report an error, because - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1304218 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Fri Mar 23 07:59:16 2012 New Revision: 1304218 URL: http://svn.apache.org/viewvc?rev=1304218view=rev Log: fixing an NPE error reported by Jorge Williams on xerces users list. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1304218r1=1304217r2=1304218view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Fri Mar 23 07:59:16 2012 @@ -2596,7 +2596,10 @@ public class XMLSchemaValidator private XSElementDecl findLocallyDeclaredType(QName element, XSCMValidator currentCM, XSTypeDefinition baseType) { -XSElementDecl elemDecl = currentCM.findMatchingElemDecl(element, fSubGroupHandler); +XSElementDecl elemDecl = null; +if (currentCM != null) { + elemDecl = currentCM.findMatchingElemDecl(element, fSubGroupHandler); +} if (elemDecl == null) { if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE baseType != SchemaGrammar.getXSAnyType(fSchemaVersion)) { - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1300055 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: ./ assertion/ opti/ traversers/ util/
Author: mukulg Date: Tue Mar 13 10:19:25 2012 New Revision: 1300055 URL: http://svn.apache.org/viewvc?rev=1300055view=rev Log: doing some minor refactoring and cleanup of schema 1.1 code base. Added: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XS11TypeHelper.java - copied, changed from r1234360, xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java Removed: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java 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/XMLAssertPsychopathXPath2Impl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/opti/SchemaDOMParser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.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=1300055r1=1300054r2=1300055view=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 Tue Mar 13 10:19:25 2012 @@ -27,7 +27,7 @@ import javax.xml.XMLConstants; import org.apache.xerces.impl.Constants; import org.apache.xerces.impl.xs.assertion.XSAssertImpl; import org.apache.xerces.impl.xs.traversers.XSDHandler; -import org.apache.xerces.impl.xs.util.XSTypeHelper; +import org.apache.xerces.impl.xs.util.XS11TypeHelper; import org.apache.xerces.util.NamespaceSupport; import org.apache.xerces.xs.XSModel; import org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext; @@ -164,10 +164,10 @@ public class AbstractPsychoPathXPath2Imp } catch (XPathParserException ex) { // XPath parser exception if (SchemaSymbols.XS11_XPATHEXPR_COMPILE_WRN_MESG_1.equals(ex.getMessage())) { -fSchemaHandler.reportSchemaWarning(cvc-xpath.3.13.4.2b, new Object[] {assertImpl.getTest().getXPathStr(), XSTypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())}, schemaContextElem); +fSchemaHandler.reportSchemaWarning(cvc-xpath.3.13.4.2b, new Object[] {assertImpl.getTest().getXPathStr(), XS11TypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())}, schemaContextElem); } else { -fSchemaHandler.reportSchemaError(cvc-xpath.3.13.4.2a, new Object[] {assertImpl.getTest().getXPathStr(), XSTypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())}, schemaContextElem); +fSchemaHandler.reportSchemaError(cvc-xpath.3.13.4.2a, new Object[] {assertImpl.getTest().getXPathStr(), XS11TypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())}, schemaContextElem); } } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1300055r1=1300054r2=1300055view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Tue Mar 13 10:19:25 2012 @@ -36,7 +36,7 @@ import org.apache.xerces.impl.xs.asserti import org.apache.xerces.impl.xs.assertion.XSAssert; import org.apache.xerces.impl.xs.assertion.XSAssertImpl; import org.apache.xerces.impl.xs.util.ObjectListImpl; -import org.apache.xerces.impl.xs.util.XSTypeHelper; +import org.apache.xerces.impl.xs.util.XS11TypeHelper
svn commit: r1290922 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sun Feb 19 01:48:55 2012 New Revision: 1290922 URL: http://svn.apache.org/viewvc?rev=1290922view=rev Log: a bug was reported by an user couple of days ago on j-us...@xerces.apache.org list (ref, http://markmail.org/message/lkjfgjryt7245mco) that if JDK assertions are enabled during XSD 1.1 validation with Xerces, a JDK level fault was thrown in certain circumstances. this updated PsychoPath engine jar has a fix for that issue. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1290922r1=1290921r2=1290922view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1233147 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
Author: mukulg Date: Thu Jan 19 01:26:26 2012 New Revision: 1233147 URL: http://svn.apache.org/viewvc?rev=1233147view=rev Log: schema 1.1 commit: prohibiting the attributes minOccurs and maxOccurs to appear on an any wild-card if it exists within openContent or defaultOpenContent. this is as per the schema for schema for XSD 1.1. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?rev=1233147r1=1233146r2=1233147view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Thu Jan 19 01:26:26 2012 @@ -318,6 +318,13 @@ class XSDComplexTypeTraverser extends X fAttrChecker.returnAttrArray(attrValues, schemaDoc); return ocDecl; } +Attr anyWcMinOccurs = child.getAttributeNode(SchemaSymbols.ATT_MINOCCURS); +Attr anyWcMaxOccurs = child.getAttributeNode(SchemaSymbols.ATT_MAXOCCURS); +if (anyWcMinOccurs != null || anyWcMaxOccurs != null) { +// prohibit the attributes minOccurs and maxOccurs to appear on an any wild-card if it exists within openContent or defaultOpenContent +// REVISIT... +reportSchemaError(s4s-att-not-allowed, new Object[]{elmNode.getLocalName()+=+SchemaSymbols.ELT_ANY, SchemaSymbols.ATT_MINOCCURS+|+SchemaSymbols.ATT_MAXOCCURS}, child); +} Object[] wcAttrValues = fAttrChecker.checkAttributes(child, false, schemaDoc); ocDecl.fWildcard = fSchemaHandler.fWildCardTraverser.traverseWildcardDecl(child, wcAttrValues, schemaDoc, grammar); fAttrChecker.returnAttrArray(wcAttrValues, schemaDoc); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1230915 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
Author: mukulg Date: Fri Jan 13 08:34:59 2012 New Revision: 1230915 URL: http://svn.apache.org/viewvc?rev=1230915view=rev Log: fixing a potential NPE issue. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?rev=1230915r1=1230914r2=1230915view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Fri Jan 13 08:34:59 2012 @@ -1696,35 +1696,33 @@ class XSDComplexTypeTraverser extends X // get 'annotation' Element childNode = DOMUtil.getFirstChildElement(assertElement); XSAnnotationImpl annotation = null; - // first child could be an annotation -if (childNode != null - DOMUtil.getLocalName(childNode).equals( -SchemaSymbols.ELT_ANNOTATION)) { -annotation = traverseAnnotationDecl(childNode, attrValues, false, schemaDoc); -// now move on to the next child element -childNode = DOMUtil.getNextSiblingElement(childNode); - -if (childNode != null) { -// it's an error to have something after the annotation, in 'assert' -reportSchemaError(s4s-elt-invalid-content.1, new Object[] { -DOMUtil.getLocalName(assertElement), -DOMUtil.getLocalName(childNode) }, childNode); -} -} else { -String text = DOMUtil.getSyntheticAnnotation(childNode); -if (text != null) { -annotation = traverseSyntheticAnnotation(childNode, text, attrValues, false, schemaDoc); +if (childNode != null) { +if (DOMUtil.getLocalName(childNode).equals(SchemaSymbols.ELT_ANNOTATION)) { +annotation = traverseAnnotationDecl(childNode, attrValues, false, schemaDoc); +// now move on to the next child element +childNode = DOMUtil.getNextSiblingElement(childNode); + +if (childNode != null) { +// it's an error to have something after the annotation, in 'assert' +reportSchemaError(s4s-elt-invalid-content.1, new Object[] { + DOMUtil.getLocalName(assertElement), + DOMUtil.getLocalName(childNode) }, childNode); +} +} else { +String text = DOMUtil.getSyntheticAnnotation(childNode); +if (text != null) { +annotation = traverseSyntheticAnnotation(childNode, text, attrValues, false, schemaDoc); +} } } - + XSObjectList annotations = null; if (annotation != null) { annotations = new XSObjectListImpl(); ((XSObjectListImpl) annotations).addXSObject(annotation); } else { -// if no annotations are present assign an empty list, for -// annotations. +// if no annotations are present assign an empty list, for annotations. annotations = XSObjectListImpl.EMPTY_LIST; } @@ -1747,15 +1745,12 @@ class XSDComplexTypeTraverser extends X // if there is sibling element if (sibling != null) { if (sibling.getLocalName().equals(SchemaSymbols.ELT_ASSERT)) { -// traverse sibling assertion elements recursively, till -// none is found +// traverse sibling assertion elements recursively, till none is found traverseAsserts(sibling, schemaDoc, grammar, enclosingCT); } else { // a non-assert element after assert is an error fAttrChecker.returnAttrArray(attrValues, schemaDoc); -throw new ComplexTypeRecoverableError( -s4s-elt-invalid-content.1, new Object[] { fName, -DOMUtil.getLocalName(sibling) }, sibling); +throw new ComplexTypeRecoverableError(s4s-elt-invalid-content.1, new Object[] { fName, DOMUtil.getLocalName(sibling) }, sibling); } } } else
svn commit: r1230970 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java
Author: mukulg Date: Fri Jan 13 09:58:12 2012 New Revision: 1230970 URL: http://svn.apache.org/viewvc?rev=1230970view=rev Log: fixing a potential NPE issue. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java?rev=1230970r1=1230969r2=1230970view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java Fri Jan 13 09:58:12 2012 @@ -487,25 +487,23 @@ abstract class XSDAbstractTraverser { // get 'annotation' Element childNode = DOMUtil.getFirstChildElement(content); XSAnnotationImpl annotation = null; + // first child could be an annotation -if (childNode != null - DOMUtil.getLocalName(childNode).equals( -SchemaSymbols.ELT_ANNOTATION)) { -annotation = traverseAnnotationDecl(childNode, attrs, -false, schemaDoc); -// now move on to the next child element -childNode = DOMUtil.getNextSiblingElement(childNode); - -if (childNode != null) { - // it's an error to have something after the annotation, in an assertion - reportSchemaError(s4s-elt-invalid-content.1, new Object[]{DOMUtil.getLocalName(content), DOMUtil.getLocalName(childNode)}, childNode); +if (childNode != null) { +if (DOMUtil.getLocalName(childNode).equals(SchemaSymbols.ELT_ANNOTATION)) { +annotation = traverseAnnotationDecl(childNode, attrs, false, schemaDoc); +// now move on to the next child element +childNode = DOMUtil.getNextSiblingElement(childNode); +if (childNode != null) { +// it's an error to have something after the annotation, in an assertion +reportSchemaError(s4s-elt-invalid-content.1, new Object[]{DOMUtil.getLocalName(content), DOMUtil.getLocalName(childNode)}, childNode); +} +} else { +String text = DOMUtil.getSyntheticAnnotation(childNode); +if (text != null) { +annotation = traverseSyntheticAnnotation(childNode, text, attrs, false, schemaDoc); +} } -} else { -String text = DOMUtil.getSyntheticAnnotation(childNode); -if (text != null) { -annotation = traverseSyntheticAnnotation(childNode, -text, attrs, false, schemaDoc); -} } XSObjectList annotations = null; - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1220337 - /xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml
Author: mukulg Date: Sun Dec 18 05:41:13 2011 New Revision: 1220337 URL: http://svn.apache.org/viewvc?rev=1220337view=rev Log: doing few minor updates to schema 1.1 docs Modified: xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml Modified: xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml?rev=1220337r1=1220336r2=1220337view=diff == --- xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml (original) +++ xerces/java/branches/xml-schema-1.1-dev/docs/faq-xs.xml Sun Dec 18 05:41:13 2011 @@ -73,28 +73,24 @@ v.validate(instanceDocument); /a /faq faq title=XPath 2.0 support for XML Schema 1.1 validation - qHow Xerces-J uses an XPath 2.0 engine for XML Schema 1.1 assertions and type alternatives?/q + qHow Xerces-J uses an XPath 2.0 engine for XML Schema 1.1 assertions and CTAs?/q a - pXML Schema 1.1 'assertions' and 'type alternatives' require an jump href=http://www.w3.org/TR/xpath20/;XPath 2.0/jump processor - for evaluation. For XSD 1.1 assertions, full XPath 2.0 support is required. For XSD 1.1 type alternatives, XML schema engines can - provide full XPath 2.0 support or they can implement a smaller XPath 2.0 subset, as defined by the XSD 1.1 language. - Within the type alternatives implementation, Xerces-J first attempts to compile the XPath expression with a native Xerces XPath subset - parser. If parsing with the native Xerces XPath subset parser fails, Xerces-J transparently switches over to another processor which - supports all of XPath 2.0. The native processor in Xerces-J was written for efficiency, so you will likely get better performance if your - XPath expressions fall within the minimum subset defined by the XML Schema 1.1 specification. For full XPath 2.0 evaluation - (for XSD 1.1 'assertions', and optionally for 'type alternatives'), Xerces-J uses the - jump href=http://wiki.eclipse.org/PsychoPathXPathProcessor;Eclipse/PsychoPath XPath 2.0 engine/jump. - /p - p - Xerces-J bundles a PsychoPath XPath 2.0 jar (which requires JDK 1.4 or later). + pXML Schema 1.1 assertions and CTAs require an XPath processor during evaluation. For XSD 1.1 assertions, + full jump href=http://www.w3.org/TR/xpath20/;XPath 2.0/jump support is required. For XSD 1.1 CTAs the XSD schema engines can + provide full XPath 2.0 support, or they can implement a jump href=http://www.w3.org/TR/xmlschema11-1/#coss-ta;smaller XPath subset/jump + as defined by the XSD 1.1 language. For CTAs Xerces uses the XSD 1.1 CTA XPath subset language by default, but can be made to use the full XPath 2.0 support by + setting the value of Xerces feature codehttp://apache.org/xml/features/validation/cta-full-xpath-checking/code to 'true'. + The native CTA XPath processor in Xerces-J was written for efficiency, so you will likely get better performance if your + XPath expressions fall within the minimum subset defined by the XML Schema 1.1 specification. For full XPath 2.0 evaluation + (for XSD 1.1 assertions, and optionally for CTAs), Xerces-J uses the jump href=http://wiki.eclipse.org/PsychoPathXPathProcessor;Eclipse/PsychoPath XPath 2.0 engine/jump. + Xerces-J does bundle along a PsychoPath XPath 2.0 jar (which requires JDK 1.4 or later). /p note - Users should be aware that more recent releases of the PsychoPath + Users should be aware that more recent releases of the Eclipse PsychoPath XPath engine may have better conformance to the W3C XPath 2.0 language than the PsychoPath XPath 2.0 jar that's bundled with Apache Xerces-J. - Builds of the PsychoPath XPath 2.0 jar are available for download from following location, - jump href=http://www.eclipse.org/webtools/;Eclipse Web Tools Platform (WTP) Project/jump - The latest 'Released' or a 'Stable milestone' - WTP version can be downloaded from here (from which the PsychoPath XPath 2.0 jar can be extracted). The latest PsychoPath XPath 2.0 engine - builds at Eclipse require a minimum JDK level of 1.5. + Official builds of the PsychoPath XPath 2.0 jar are available for download from the location, jump href=http://www.eclipse.org/webtools/;Eclipse Web Tools Platform (WTP) Project/jump - + The latest 'Released' or a 'Stable milestone' WTP version can be downloaded from here (from which the PsychoPath XPath 2.0 jar can be extracted). + The latest PsychoPath XPath 2.0 engine builds at Eclipse require a minimum JDK level of 1.5. /note /a /faq
svn commit: r1210087 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/override/DOMOverrideImpl.java
Author: mukulg Date: Sun Dec 4 09:49:28 2011 New Revision: 1210087 URL: http://svn.apache.org/viewvc?rev=1210087view=rev Log: an W3C XSD 1.1 test case requires that, if a complexType overrides a simpleType (or vice versa, if a simpleType overrides a complexType) with the same name then that is not an error. earlier we were raising an error for this condition. i've changed the implementation to raise a warning instead for this case, and we then also comply to this test case. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/override/DOMOverrideImpl.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/override/DOMOverrideImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/override/DOMOverrideImpl.java?rev=1210087r1=1210086r2=1210087view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/override/DOMOverrideImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/override/DOMOverrideImpl.java Sun Dec 4 09:49:28 2011 @@ -174,7 +174,7 @@ public final class DOMOverrideImpl exten if (componentType == OVERRIDE_TYPE_DEFINITION) { final String overridingLocalName = getLocalName(newNode.originalElement); if (!localName.equals(overridingLocalName)) { - fSchemaHandler.reportSchemaError(src-override-transformation.1, new Object[]{overridingLocalName, localName, componentName}, newNode.originalElement); + fSchemaHandler.reportSchemaWarning(src-override-transformation.1, new Object[]{overridingLocalName, localName, componentName}, newNode.originalElement); if (isOverrideRoot){ newNode.overrideCloned = true; } @@ -251,7 +251,7 @@ public final class DOMOverrideImpl exten } private int getOverrideType(String localName){ -if (localName.equals(SchemaSymbols.ELT_SIMPLETYPE) || localName.equals(SchemaSymbols.ELT_COMPLEXTYPE )){ +if (localName.equals(SchemaSymbols.ELT_SIMPLETYPE) || localName.equals(SchemaSymbols.ELT_COMPLEXTYPE)){ return OVERRIDE_TYPE_DEFINITION; } else if (localName.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP) ){ - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1208946 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/ impl/xs/ impl/xs/traversers/ jaxp/validation/ parsers/
Author: mukulg Date: Thu Dec 1 03:57:40 2011 New Revision: 1208946 URL: http://svn.apache.org/viewvc?rev=1208946view=rev Log: committing an implementation of a feature to control, if comment and PI nodes should be visible in schema 1.1 assert XDM trees. the default value of this feature is 'false'; therefore by default, comments and PIs won't be visible within assert XDM trees and an opposite behavior for this could be enabled by setting this feature to 'true'. the decision to provide an user option for this, was recently made by the XML Schema WG. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaValidatorComponentManager.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/StandardParserConfiguration.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/XML11Configuration.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java?rev=1208946r1=1208945r2=1208946view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java Thu Dec 1 03:57:40 2011 @@ -337,6 +337,9 @@ public final class Constants { /** Feature to control full XPath 2.0 checking for CTA processing */ public static final String CTA_FULL_XPATH_CHECKING_FEATURE = validation/cta-full-xpath-checking; +/** Feature to control, if comments and PIs should be available in assert XDM trees */ +public static final String ASSERT_COMMENT_PI_CHECKING_FEATURE = validation/assert-comments-and-pi-checking; + /** Feature to ignore errors caused by unparsed entities (validation/unparsed-entity-checking) */ public static final String UNPARSED_ENTITY_CHECKING_FEATURE = validation/unparsed-entity-checking; @@ -559,6 +562,7 @@ public final class Constants { STRINGS_INTERNED_FEATURE, TYPE_ALTERNATIVES_CHEKING_FEATURE, CTA_FULL_XPATH_CHECKING_FEATURE, +ASSERT_COMMENT_PI_CHECKING_FEATURE, }; /** Xerces properties. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java?rev=1208946r1=1208945r2=1208946view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java Thu Dec 1 03:57:40 2011 @@ -146,10 +146,14 @@ XSLoader, DOMConfiguration { protected static final String TOLERATE_DUPLICATES = Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE; -/** Feature identifier: tolerate duplicates */ +/** Feature identifier: full XPath 2.0 support for CTA */ protected static final String CTA_FULL_XPATH = Constants.XERCES_FEATURE_PREFIX + Constants.CTA_FULL_XPATH_CHECKING_FEATURE; +/** Feature identifier: comment and PI nodes for assert */ +protected static final String ASSERT_COMMENT_PI = +Constants.XERCES_FEATURE_PREFIX + Constants.ASSERT_COMMENT_PI_CHECKING_FEATURE; + /** Property identifier: Schema DV Factory */ protected static final String SCHEMA_DV_FACTORY = Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY; @@ -168,6 +172,7 @@ XSLoader, DOMConfiguration { NAMESPACE_GROWTH, TOLERATE_DUPLICATES, CTA_FULL_XPATH, +ASSERT_COMMENT_PI, }; // property identifiers Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1208946r1=1208945r2=1208946view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Thu Dec 1 03
svn commit: r1205359 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Author: mukulg Date: Wed Nov 23 10:43:29 2011 New Revision: 1205359 URL: http://svn.apache.org/viewvc?rev=1205359view=rev Log: in some cases, XSD 1.1 assertion evaluations produce a lengthy and undesirable stack trace on standard output. i'm providing a quick fix for this problem (by suppressing the java exception). here's a test case for this, XML document: Xg/X schema document fragment: xs:element name=X xs:simpleType xs:restriction base=xs:integer xs:assertion test=$value mod 2 = 0/ /xs:restriction /xs:simpleType /xs:element before this fix, Xerces produced following output when above validation was invoked, [Error] test.xml:1:9: cvc-datatype-valid.1.2.1: 'g' is not a valid value for 'integer'. [Error] test.xml:1:9: cvc-type.3.1.3: The value 'g' of element 'X' is not valid. error: Parse error occurred - For input string: g java.lang.NumberFormatException: For input string: g at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.math.BigInteger.init(Unknown Source) ... This commit improves the error message that's produced in such cases. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1205359r1=1205358r2=1205359view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Wed Nov 23 10:43:29 2011 @@ -2739,7 +2739,12 @@ public class XMLSchemaValidator // delegate to assertions validator subcomponent if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { -assertionValidatorEndElementDelegate(element); +try { + assertionValidatorEndElementDelegate(element); +} +catch(Exception ex) { + // NO OP +} } // Check if we should modify the xsi:type ignore depth - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1205718 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: msg/XMLSchemaMessages.properties xs/traversers/XSDComplexTypeTraverser.java
Author: mukulg Date: Thu Nov 24 03:52:18 2011 New Revision: 1205718 URL: http://svn.apache.org/viewvc?rev=1205718view=rev Log: defining a missing error code in schema 1.1 properties file. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1205718r1=1205717r2=1205718view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Thu Nov 24 03:52:18 2011 @@ -185,7 +185,8 @@ src-type-alternative.3.12.13.1 = src-type-alternative.3.12.13.1: Type atlernative has both a ''type'' attribute and a ''anonymous type'' child. Only one of these is allowed for a type alternative. src-type-alternative.3.12.13.2 = src-type-alternative.3.12.13.2: Type definition missing for type atlernative. A ''type'' attribute, or a ''complexType'' child element, or a ''simpleType'' child element must be present. src-wildcard.1 = src-wildcard.1: The properties ''namespace'' and ''notNamespace'' cannot both be present in a wildcard declaration. Use only one of them. -src-cip.1 = src-cip.1: The attribute ''{0}'' does not belong to schema versioning namespace (http://www.w3.org/2007/XMLSchema-versioning). Only following attributes are available for schema versioning namespace : ''minVersion'', ''maxVersion'', ''typeAvailable'', ''typeUnavailable'', ''facetAvailable'' and ''facetUnavailable''. +src-cip.1 = src-cip.1: The attribute ''{0}'' does not belong to schema versioning namespace (http://www.w3.org/2007/XMLSchema-versioning). Only following attributes are available for schema versioning namespace : ''minVersion'', ''maxVersion'', ''typeAvailable'', ''typeUnavailable'', ''facetAvailable'' and ''facetUnavailable''. +src-assert.3.13.1 = src-assert.3.13.1: The mandatory attribute ''test'' does not appear on the element ''assert'', within type definition ''{0}''. #constraint valid (3.X.6) Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?rev=1205718r1=1205717r2=1205718view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Thu Nov 24 03:52:18 2011 @@ -42,6 +42,7 @@ import org.apache.xerces.impl.xs.asserti import org.apache.xerces.impl.xs.assertion.XSAssertImpl; import org.apache.xerces.impl.xs.util.XInt; import org.apache.xerces.impl.xs.util.XSObjectListImpl; +import org.apache.xerces.impl.xs.util.XSTypeHelper; import org.apache.xerces.util.DOMUtil; import org.apache.xerces.util.XMLChar; import org.apache.xerces.util.XMLSymbols; @@ -1758,8 +1759,8 @@ class XSDComplexTypeTraverser extends X } } } else { -// 'test' attribute is mandatory in an assert element -reportSchemaError(src-assert.3.13.1, new Object[] { DOMUtil.getLocalName(assertElement) }, assertElement); +// 'test' attribute is mandatory on an assert element +reportSchemaError(src-assert.3.13.1, new Object[] { XSTypeHelper.getSchemaTypeName(enclosingCT) }, assertElement); } fAttrChecker.returnAttrArray(attrValues, schemaDoc); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1205731 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: msg/XMLSchemaMessages.properties xs/traversers/XSDAbstractTraverser.java xs/traversers/XSDComplexTypeTrav
Author: mukulg Date: Thu Nov 24 06:11:12 2011 New Revision: 1205731 URL: http://svn.apache.org/viewvc?rev=1205731view=rev Log: making changes to implement the schema 1.1 error code src-assert.3.13.1 consistently for assert and assertion. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1205731r1=1205730r2=1205731view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Thu Nov 24 06:11:12 2011 @@ -186,7 +186,7 @@ src-type-alternative.3.12.13.2 = src-type-alternative.3.12.13.2: Type definition missing for type atlernative. A ''type'' attribute, or a ''complexType'' child element, or a ''simpleType'' child element must be present. src-wildcard.1 = src-wildcard.1: The properties ''namespace'' and ''notNamespace'' cannot both be present in a wildcard declaration. Use only one of them. src-cip.1 = src-cip.1: The attribute ''{0}'' does not belong to schema versioning namespace (http://www.w3.org/2007/XMLSchema-versioning). Only following attributes are available for schema versioning namespace : ''minVersion'', ''maxVersion'', ''typeAvailable'', ''typeUnavailable'', ''facetAvailable'' and ''facetUnavailable''. -src-assert.3.13.1 = src-assert.3.13.1: The mandatory attribute ''test'' does not appear on the element ''assert'', within type definition ''{0}''. +src-assert.3.13.1 = src-assert.3.13.1: The mandatory attribute ''test'' does not appear on the element ''{0}'', within type definition ''{1}''. #constraint valid (3.X.6) Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java?rev=1205731r1=1205730r2=1205731view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java Thu Nov 24 06:11:12 2011 @@ -38,6 +38,7 @@ import org.apache.xerces.impl.xs.asserti import org.apache.xerces.impl.xs.assertion.XSAssertImpl; import org.apache.xerces.impl.xs.util.XInt; import org.apache.xerces.impl.xs.util.XSObjectListImpl; +import org.apache.xerces.impl.xs.util.XSTypeHelper; import org.apache.xerces.util.DOMUtil; import org.apache.xerces.util.NamespaceSupport; import org.apache.xerces.util.SymbolTable; @@ -535,10 +536,8 @@ abstract class XSDAbstractTraverser { // add assertion object, to the list of assertions to be processed assertData.addElement(assertImpl); } else { -// 'test' attribute is mandatory in assert element -reportSchemaError(src-assert.3.13.1, -new Object[] { DOMUtil.getLocalName(content) }, -content); +// 'test' attribute is mandatory on an assertion element +reportSchemaError(src-assert.3.13.1, new Object[] { DOMUtil.getLocalName(content), XSTypeHelper.getSchemaTypeName(typeDef) }, content); } } else { if (facet.equals(SchemaSymbols.ELT_MINLENGTH)) { Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java?rev=1205731r1=1205730r2=1205731view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java Thu Nov 24 06:11:12 2011 @@ -1759,8 +1759,8 @@ class XSDComplexTypeTraverser extends X } } } else { -// 'test' attribute
svn commit: r1201259 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sat Nov 12 13:33:05 2011 New Revision: 1201259 URL: http://svn.apache.org/viewvc?rev=1201259view=rev Log: schema 1.1 commit: committing an improved PsychoPath XPath jar. This has improvement for the XPath 2.0 fn:abs function implementation. fn:abs implementation wasn't earlier atomizing the operand, and as a consequence the following use case wasn't working as expected (this was incorrectly raising a type error earlier), XML document: X a-5/a /X Schema fragment: xs:element name=X xs:complexType xs:sequence xs:element name=a type=xs:integer/ /xs:sequence xs:assert test=abs(a) = 5/ /xs:complexType /xs:element This commit solves this problem. The corresponding code base was also updated at Eclipse CVS site. I thank Łukasz Wycisk, who pointed out this problem on wtp-wst-...@eclipse.org list and proposed a solution. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1201259r1=1201258r2=1201259view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1201280 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sat Nov 12 16:03:07 2011 New Revision: 1201280 URL: http://svn.apache.org/viewvc?rev=1201280view=rev Log: schema 1.1 commit: improving implementation of XPath 2.0 fn:index-of function. this now supports QName values as the second argument (this wasn't supported earlier). This enhancement now passes uses cases like following, XML document: X a2/a b4/b c6/c /X All of the below function calls (using the XML document above) now correctly return the sequence {2}, index-of(for $e in X/* return node-name($e), node-name(X/b)) index-of(for $e in X/* return node-name($e), xs:QName('b')) index-of(for $e in X/* return node-name($e), fn:QName('', 'b')) committing a new PsychoPath XPath jar with these improvements. The corresponding code base at Eclipse CVS is also updated with these changes. I thank Łukasz Wycisk, who pointed out this problem on the wtp-wst-...@eclipse.org list and suggested a solution. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1201280r1=1201279r2=1201280view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1198718 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XMLAssertPsychopathXPath2Impl.java XMLSchemaValidator.java XSDAssertionValidator.java assertion/XMLAss
Author: mukulg Date: Mon Nov 7 13:02:34 2011 New Revision: 1198718 URL: http://svn.apache.org/viewvc?rev=1198718view=rev Log: adding support for comment and PI nodes for XML Schema 1.1 assert XDM trees. this was possible after yesterday's enhancement by Michael Glavassevich adding support for this in earlier stages of XSD validation pipeline. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XMLAssertAdapter.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XMLAssertHandler.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1198718r1=1198717r2=1198718view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Mon Nov 7 13:02:34 2011 @@ -76,7 +76,7 @@ import org.w3c.dom.Element; public class XMLAssertPsychopathXPath2Impl extends XMLAssertAdapter { // class fields declarations - + // XSModel instance representing the schema information needed by PsychoPath XPath 2.0 engine private XSModel fSchemaXSmodel = null; @@ -251,6 +251,28 @@ public class XMLAssertPsychopathXPath2Im } // endElement +/* (non-Javadoc) + * @see org.apache.xerces.impl.xs.assertion.XMLAssertAdapter#comment(org.apache.xerces.xni.XMLString) + */ +public void comment(XMLString text) { +// add a comment node to the assertions, DOM tree +if (fCurrentAssertDomNode != null) { + fCurrentAssertDomNode.appendChild(fAssertDocument.createComment(new String(text.ch, text.offset, text.length))); +} +} // comment + + +/* (non-Javadoc) + * @see org.apache.xerces.impl.xs.assertion.XMLAssertAdapter#processingInstruction(java.lang.String, org.apache.xerces.xni.XMLString) + */ +public void processingInstruction(String target, XMLString data) { +// add a PI node to the assertions, DOM tree +if (fCurrentAssertDomNode != null) { + fCurrentAssertDomNode.appendChild(fAssertDocument.createProcessingInstruction(target, new String(data.ch, data.offset, data.length))); +} +} // processingInstruction + + /* * set value of [failed assertions] PSVI property. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1198718r1=1198717r2=1198718view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Mon Nov 7 13:02:34 2011 @@ -1145,6 +1145,10 @@ public class XMLSchemaValidator */ public void comment(XMLString text, Augmentations augs) throws XNIException { +if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { +fAssertionValidator.comment(text); +} + // call handlers if (fDocumentHandler != null) { fDocumentHandler.comment(text, augs); @@ -1171,6 +1175,10 @@ public class XMLSchemaValidator */ public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException { + +if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { +fAssertionValidator.processingInstruction(target, data); +} // call handlers if (fDocumentHandler != null) { Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java?rev=1198718r1=1198717r2=1198718view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java
svn commit: r1198396 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: msg/XMLSchemaMessages.properties xs/AbstractPsychoPathXPath2Impl.java xs/SchemaSymbols.java xs/traversers
Author: mukulg Date: Sun Nov 6 16:12:05 2011 New Revision: 1198396 URL: http://svn.apache.org/viewvc?rev=1198396view=rev Log: schema 1.1 commit: similar to the assertions behavior when, the XPath expression contains tokens '/' or '//' we used to raise warning for the schema (since an assert XDM tree is rooted at a parentless element), i've implemented the same behavior for CTA while working in XPath full mode (where that's also the case; the CTA XDM tree is also rooted at a parentless element). there are also few minor refactoring code base changes. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties 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/SchemaSymbols.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1198396r1=1198395r2=1198396view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Sun Nov 6 16:12:05 2011 @@ -112,7 +112,7 @@ cvc-assertions-valid-union-elem = cvc-assertions-valid-union-elem: Value ''{0}'' is not facet-valid with respect to the specified assertions, on type ''{2}'' on element ''{1}''. cvc-assertions-valid-union-attr = cvc-assertions-valid-union-attr: Value ''{0}'' is not facet-valid with respect to the specified assertions, on type ''{3}'' on attribute ''{2}'/@'{1}''. cvc-xpath.3.13.4.2a = cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression (''{0}'') on the schema type ''{1}'' couldn''t compile successfully. -cvc-xpath.3.13.4.2b = cvc-xpath.3.13.4.2b: An assert XPath expression such as (''{0}'') beginning with / or //, on the schema type ''{1}'', cannot yield a valid node (since an assert tree is rooted at a parentless element). +cvc-xpath.3.13.4.2b = cvc-xpath.3.13.4.2b: An assert XPath expression such as (''{0}'') containing / or //, on the schema type ''{1}'', cannot yield a valid result (since an assert tree is rooted at a parentless element). #schema valid (3.X.3) @@ -349,6 +349,7 @@ c-general-xpath = c-general-xpath: The expression ''{0}'' is not valid with respect to the XPath subset supported by XML Schema. c-general-xpath-ns = c-general-xpath-ns: A namespace prefix in XPath expression ''{0}'' was not bound to a namespace. c-cta-xpath = c-cta-xpath: The XPath expression ''{0}'' couldn''t compile successfully in ''{1}'' mode, during CTA evaluation. +c-cta-xpath-b = c-cta-xpath-b: The CTA XPath expression such as (''{0}'') containing / or //, while in ''{1}'' mode, cannot yield a valid result (since a CTA tree is rooted at a parentless element). c-cta-xpath-serr = c-cta-xpath-serr: The XPath expression ''{0}'' couldn''t compile successfully in ''{1}'' mode, during CTA evaluation. A static error ''{2}'' occured in the XPath expression. c-selector-xpath = c-selector-xpath: The selector value = ''{0}'' is not valid; selector xpaths cannot contain attributes. EmptyTargetNamespace = EmptyTargetNamespace: In schema document ''{0}'', the value of the ''targetNamespace'' attribute cannot be an empty string. 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=1198396r1=1198395r2=1198396view=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 Sun Nov 6 16:12:05 2011 @@ -162,8 +162,8 @@ public class AbstractPsychoPathXPath2Imp try { xpathObject = xpathParser.parse(boolean( + xpathStr + ), true); } catch (XPathParserException ex) { -// error compiling XPath expression -if (SchemaSymbols.ASSERT_XPATHEXPR_COMPILE_ERR_MESG_1.equals(ex.getMessage())) { +// XPath parser exception +if (SchemaSymbols.XS11_XPATHEXPR_COMPILE_WRN_MESG_1.equals(ex.getMessage
svn commit: r1197621 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: xpath/ xs/ xs/assertion/ xs/traversers/
Author: mukulg Date: Fri Nov 4 16:07:45 2011 New Revision: 1197621 URL: http://svn.apache.org/viewvc?rev=1197621view=rev Log: schema 1.1 commit: it seemed to me that the class XPath20Assert in org.apache.xerces.impl.xpath was superfluously modeled, and it's functionality could be made available in class Test (in org.apache.xerces.impl.xs.assertion). this commit makes improvement in this regard. Removed: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/XPath20Assert.java 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/XMLAssertPsychopathXPath2Impl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/Test.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.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=1197621r1=1197620r2=1197621view=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 Fri Nov 4 16:07:45 2011 @@ -164,10 +164,10 @@ public class AbstractPsychoPathXPath2Imp } catch (XPathParserException ex) { // error compiling XPath expression if (SchemaSymbols.ASSERT_XPATHEXPR_COMPILE_ERR_MESG_1.equals(ex.getMessage())) { -fSchemaHandler.reportSchemaWarning(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().getXPathStr(), 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); +fSchemaHandler.reportSchemaError(cvc-xpath.3.13.4.2a, new Object[] {assertImpl.getTest().getXPathStr(), XSTypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())}, schemaContextElem); } } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1197621r1=1197620r2=1197621view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Fri Nov 4 16:07:45 2011 @@ -718,12 +718,12 @@ public class XMLAssertPsychopathXPath2Im else { if (assertImpl.getAssertKind() == XSConstants.ASSERTION) { // error for xs:assert component - fXmlSchemaValidator.reportSchemaError(key, new Object[] {elemNameAnnotation, assertImpl.getTest().getXPath().toString(), typeNameStr, mesgSuffix}); + fXmlSchemaValidator.reportSchemaError(key, new Object[] {elemNameAnnotation, assertImpl.getTest().getXPathStr(), typeNameStr, mesgSuffix}); } else { // errors for xs:assertion facet - fXmlSchemaValidator.reportSchemaError(cvc-assertions-valid, new Object[] {value, assertImpl.getTest().getXPath().toString(), exceptionMesg}); - fXmlSchemaValidator.reportSchemaError(key, new Object[] {elemNameAnnotation, assertImpl.getTest().getXPath().toString(), typeNameStr, mesgSuffix}); + fXmlSchemaValidator.reportSchemaError(cvc-assertions-valid, new Object[] {value, assertImpl.getTest().getXPathStr(), exceptionMesg}); + fXmlSchemaValidator.reportSchemaError(key, new Object[] {elemNameAnnotation, assertImpl.getTest().getXPathStr(), typeNameStr, mesgSuffix}); } } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs
svn commit: r1195123 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sun Oct 30 06:43:17 2011 New Revision: 1195123 URL: http://svn.apache.org/viewvc?rev=1195123view=rev Log: committing an improved PsychoPath XPath jar. checks like following xs:assert test=. instance of element(*, xs:anyType)/, went into infinite loop if the type T in ElementTest, element(.., T) is not in the XPath context. this commit resolves this problem. the corresponding commit was also made at Eclipse CVS. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1195123r1=1195122r2=1195123view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1195303 - in /xerces/java/branches/xml-schema-1.1-dev: src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Mon Oct 31 01:58:37 2011 New Revision: 1195303 URL: http://svn.apache.org/viewvc?rev=1195303view=rev Log: schema 1.1 commit: providing an implementation to have non document node (currently only element nodes are supported as XDM roots other than the document node) as root node of XPath2 XDM tree. Providing an enhanced PsychoPath XPath jar with this improvement, along with corresponding Xerces improvements. Corresponding changes were also made at Eclipse CVS (ref, Eclipse bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=362446). this improvement also solves the XSD 1.1 test suite test, cta0017.v01. 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/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar 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=1195303r1=1195302r2=1195303view=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 Mon Oct 31 01:58:37 2011 @@ -118,8 +118,8 @@ public class AbstractPsychoPathXPath2Imp StaticChecker sc = new StaticNameResolver(fXpath2DynamicContext); sc.check(xpathObject); Evaluator xpath2Evaluator = null; -if (contextNode != null) { -xpath2Evaluator = new DefaultEvaluator(fXpath2DynamicContext, fDomDoc); +if (contextNode != null) { +xpath2Evaluator = new DefaultEvaluator(fXpath2DynamicContext, fDomDoc, fDomDoc.getDocumentElement()); // for assertions and CTA, root node of XDM tree is the initial context element // change focus to the top most element ResultSequence contextNodeResultSet = ResultSequenceFactory.create_new(); contextNodeResultSet.add(new ElementType(contextNode, fXpath2DynamicContext.node_position(contextNode))); Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1195303r1=1195302r2=1195303view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1194855 - in /xerces/java/branches/xml-schema-1.1-dev: src/org/apache/xerces/impl/xs/SchemaGrammar.java src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java tools/org.eclipse.
Author: mukulg Date: Sat Oct 29 09:44:17 2011 New Revision: 1194855 URL: http://svn.apache.org/viewvc?rev=1194855view=rev Log: schema 1.1 commit: XSD 1.1 assertions require the root node of assert XDM tree to be untyped (this was tested in couple of XSD 1.1 test suite tests), and all other nodes of assert tree need to be typed. The typed value of the assert root node needs to be also annotated with the type untypedAtomic. We were earlier non compliant for this feature, and this commit provides this enhancement. These changes also required few improvements to PsychoPath XPath engine, whose updated jar is also provided with this commit. The corresponding PsychoPath XPath engine code base at Eclipse CVS was also updated. There are also few minor javadoc improvements in this commit. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java?rev=1194855r1=1194854r2=1194855view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java Sat Oct 29 09:44:17 2011 @@ -1228,7 +1228,7 @@ public class SchemaGrammar implements XS return type == fAnyType || type == fAnyType11 || type == fAnyTypeExtended; } -private static class XSAnyType extends XSComplexTypeDecl { +public static class XSAnyType extends XSComplexTypeDecl { public XSAnyType () { fName = SchemaSymbols.ATTVAL_ANYTYPE; super.fTargetNamespace = SchemaSymbols.URI_SCHEMAFORSCHEMA; Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1194855r1=1194854r2=1194855view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Sat Oct 29 09:44:17 2011 @@ -60,11 +60,11 @@ import org.w3c.dom.Element; /** * Class implementing an XPath interface for XML Schema 1.1 assertions evaluation. * This class interfaces with the Eclipse/PsychoPath XPath 2.0 engine for XPath - * expression evaluations for XML Schema assertions. + * expression evaluations for XSD assertions. * - * We construct here Xerces PSVI enabled DOM trees (on which PsychoPath XPath 2.0 - * engine operates) from XNI event calls, for typed XDM instance support. XML Schema - * assertions are evaluated on these XPath tree instances in a bottom up fashion. + * An instance of this class constructs Xerces PSVI enabled DOM trees (which are in-memory XDM + * representation for PsychoPath XPath 2.0 engine) from XNI event calls. XSD assertions + * are evaluated on these PSVI XDM instances in a bottom up fashion. * * @xerces.internal * @@ -107,6 +107,9 @@ public class XMLAssertPsychopathXPath2Im // failed assertions for an element information item private XSAssert[] fFailedAssertions = null; +// state to save the assert root type information, of the current assertion evaluation +private XSTypeDefinition fAsertRootTypeDef = null; + /* * Class constructor. @@ -268,12 +271,15 @@ public class XMLAssertPsychopathXPath2Im initXPathProcessor(); // determine string value of XPath2 context variable $value -String value = computeStringValueOf$value(fCurrentAssertDomNode, (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI)); +ElementPSVI elemPsvi = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI); +String value = computeStringValueOf$value(fCurrentAssertDomNode, elemPsvi); // evaluate assertions if (assertions instanceof XSObjectList) { -// assertions from a complex type definition -evaluateAssertionsFromAComplexType(element, assertions, value, augs); +// assertions from a complex type definition +ElementPSVImpl modifiedRootNodePsvi = savePsviInfoWithUntypingOfAssertRoot(elemPsvi, true); +evaluateAssertionsFromAComplexType(element, assertions, value, augs
svn commit: r1194862 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java
Author: mukulg Date: Sat Oct 29 10:09:48 2011 New Revision: 1194862 URL: http://svn.apache.org/viewvc?rev=1194862view=rev Log: doing minor variable spelling correction Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1194862r1=1194861r2=1194862view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java Sat Oct 29 10:09:48 2011 @@ -108,7 +108,7 @@ public class XMLAssertPsychopathXPath2Im private XSAssert[] fFailedAssertions = null; // state to save the assert root type information, of the current assertion evaluation -private XSTypeDefinition fAsertRootTypeDef = null; +private XSTypeDefinition fAssertRootTypeDef = null; /* @@ -294,7 +294,7 @@ public class XMLAssertPsychopathXPath2Im */ private ElementPSVImpl savePsviInfoWithUntypingOfAssertRoot(ElementPSVI elemPsvi, boolean isSetXsAny) { ElementPSVImpl assertRootPsvi = new ElementPSVImpl(true, elemPsvi); -fAsertRootTypeDef = assertRootPsvi.getTypeDefinition(); +fAssertRootTypeDef = assertRootPsvi.getTypeDefinition(); if (isSetXsAny) { assertRootPsvi.fTypeDecl = new SchemaGrammar.XSAnyType(); ((PSVIElementNSImpl)fCurrentAssertDomNode).setPSVI(assertRootPsvi); @@ -308,8 +308,8 @@ public class XMLAssertPsychopathXPath2Im */ private void restorePsviInfoForXPathContext(ElementPSVI elemPsvi) { ElementPSVImpl assertRootPsvi = (ElementPSVImpl)elemPsvi; -if (fAsertRootTypeDef != null) { - assertRootPsvi.fTypeDecl = fAsertRootTypeDef; +if (fAssertRootTypeDef != null) { + assertRootPsvi.fTypeDecl = fAssertRootTypeDef; ((PSVIElementNSImpl)fCurrentAssertDomNode).setPSVI(assertRootPsvi); } } // restorePsviInfoForXPathContext - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1190401 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Fri Oct 28 15:36:00 2011 New Revision: 1190401 URL: http://svn.apache.org/viewvc?rev=1190401view=rev Log: committing an improved PsychoPath XPath jar. this improvement solves the XSD 1.1 test suite test, s3_12ii06s. we now do extra static checks within PsychoPath engine, to check if the target type of cast as is an atomic type and is present in the in-scope schema types. the corresponding code base at Eclipse CVS was also updated for this improvement. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1190401r1=1190400r2=1190401view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1188817 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Tue Oct 25 17:31:31 2011 New Revision: 1188817 URL: http://svn.apache.org/viewvc?rev=1188817view=rev Log: committing a fix into PsychoPath XPath engine. this has some further improvements for function fn:namespace-uri-from-QName(..). Here's an XSD 1.1 use case which now works with this fix, XML document: X xmlns=http://x.y; Y/ /X Schema 1.1 document: xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=http://x.y; elementFormDefault=qualified xs:element name=X xs:complexType xs:sequence xs:element name=Y/ /xs:sequence xs:assert test=namespace-uri-from-QName(node-name(ns0:Y)) = 'http://x.y' xmlns:ns0=http://x.y/ /xs:complexType /xs:element /xs:schema fn:namespace-uri-from-QName(..) taking result of fn:node-name as argument wasn't previously working. Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1188817r1=1188816r2=1188817view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1187865 - in /xerces/java/branches/xml-schema-1.1-dev: src/org/apache/xerces/impl/xs/alternative/Test.java tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sun Oct 23 11:09:21 2011 New Revision: 1187865 URL: http://svn.apache.org/viewvc?rev=1187865view=rev Log: schema 1.1 commit: made few fixes to meet requirements of more XSD 1.1 test suite tests, that involve checks like following in CTA XPath expressions, . instance of element(*, xs:untyped) and @type instance of attribute(*, xs:untypedAtomic) This also needs an improved PsychoPath XPath engine jar, that is also provided with this commit (ref Eclipse bug, https://bugs.eclipse.org/bugs/show_bug.cgi?id=361748). Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java?rev=1187865r1=1187864r2=1187865view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java Sun Oct 23 11:09:21 2011 @@ -23,8 +23,10 @@ import java.util.Map; import javax.xml.XMLConstants; +import org.apache.xerces.dom.CoreDocumentImpl; import org.apache.xerces.dom.PSVIAttrNSImpl; import org.apache.xerces.dom.PSVIDocumentImpl; +import org.apache.xerces.dom.PSVIElementNSImpl; import org.apache.xerces.impl.Constants; import org.apache.xerces.impl.xpath.XPath20; import org.apache.xerces.impl.xs.AbstractPsychoPathXPath2Impl; @@ -136,7 +138,7 @@ public class Test extends AbstractPsycho // to provide to PsychoPath XPath engine for evaluation. Document document = new PSVIDocumentImpl(); document.setDocumentURI(expandedSystemId); // an approximation (the URI of the parent document) of the document URI for this alternative, document tree -Element elem = document.createElementNS(element.uri, element.rawname); +Element elem = new PSVIElementNSImpl((CoreDocumentImpl) document, element.uri, element.rawname); for (int attrIndx = 0; attrIndx attributes.getLength(); attrIndx++) { PSVIAttrNSImpl attrNode = new PSVIAttrNSImpl((PSVIDocumentImpl)document, attributes.getURI(attrIndx), attributes.getQName(attrIndx)); attrNode.setNodeValue(attributes.getValue(attrIndx)); Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1187865r1=1187864r2=1187865view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1187678 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java
Author: mukulg Date: Sat Oct 22 09:30:42 2011 New Revision: 1187678 URL: http://svn.apache.org/viewvc?rev=1187678view=rev Log: committing a minor variable renaming Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.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=1187678r1=1187677r2=1187678view=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 Sat Oct 22 09:30:42 2011 @@ -75,8 +75,8 @@ public class AbstractPsychoPathXPath2Imp // populate the 'PsychoPath XPath 2' static context, with namespace bindings derived from the XML Schema document NamespaceSupport xpath2NamespaceContext = (NamespaceSupport) psychoPathParams.get(Constants.XPATH2_NAMESPACE_CONTEXT); -Boolean isCtaAvaluator = (Boolean)psychoPathParams.get(Constants.IS_CTA_EVALUATOR); -if (isCtaAvaluator != null isCtaAvaluator.booleanValue()) { +Boolean isCtaEvaluator = (Boolean)psychoPathParams.get(Constants.IS_CTA_EVALUATOR); +if (isCtaEvaluator != null isCtaEvaluator.booleanValue()) { // check if the call to this method came from CTA evaluator. needs special treatment for handling namespace context. String[] namespaceBindingInfo = xpath2NamespaceContext.getNamespaceBindingInfo(); List prefixes = getPrefixesXS11CTA(namespaceBindingInfo); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1187442 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java
Author: mukulg Date: Fri Oct 21 16:18:28 2011 New Revision: 1187442 URL: http://svn.apache.org/viewvc?rev=1187442view=rev Log: schema 1.1 commit: setting base-uri property of XPath2 static context, to the URI of XSD document while processing CTA. this is expected in one of XSD 1.1 test suite tests. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java?rev=1187442r1=1187441r2=1187442view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java Fri Oct 21 16:18:28 2011 @@ -33,6 +33,7 @@ import org.apache.xerces.util.NamespaceS import org.apache.xerces.xni.NamespaceContext; import org.apache.xerces.xni.QName; import org.apache.xerces.xni.XMLAttributes; +import org.eclipse.wst.xml.xpath2.processor.DynamicContext; import org.eclipse.wst.xml.xpath2.processor.ast.XPath; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -158,7 +159,8 @@ public class Test extends AbstractPsycho // construct parameter values for psychopath xpath processor Map psychoPathParams = new HashMap(); psychoPathParams.put(Constants.XPATH2_NAMESPACE_CONTEXT, fXPath2NamespaceContext); -initXPath2DynamicContext(null, document, psychoPathParams); +DynamicContext xpath2DynamicContext = initXPath2DynamicContext(null, document, psychoPathParams); +xpath2DynamicContext.set_base_uri(fTypeAlternative.getBaseURI()); // set base-uri property in XPath2 static context, to the URI of XSD document if (fTypeAlternative.fXPathDefaultNamespace != null) { addNamespaceBindingToXPath2DynamicContext(null, fTypeAlternative.fXPathDefaultNamespace); } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1180543 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: ./ msg/ xs/ xs/alternative/ xs/traversers/ xs/util/
Author: mukulg Date: Sun Oct 9 04:34:12 2011 New Revision: 1180543 URL: http://svn.apache.org/viewvc?rev=1180543view=rev Log: committing a schema 1.1 fix. started with fixing implementation to comply to the XSD 1.1 test case cta9003err (contributed by Saxonica). doing additional static checking of XPath expression, in XSDTypeAlternativeTraverser to abort processing and raise error, if for example a schema type used in the XPath expression isn't present in the XPath static context (which is been tested by the test case mentioned above). have also done minor refactoring in other parts of code base (also in class XSTypeHelper, which is not related to the functional fix for this commit). Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties 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/XSDAssertionValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java?rev=1180543r1=1180542r2=1180543view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java Sun Oct 9 04:34:12 2011 @@ -497,6 +497,9 @@ public final class Constants { public final static short TYPE_AND_FACET_AVAILABILITY = 2; public final static short TYPE_AND_FACET_UNAVAILABILITY = 3; +// Constants to support PsychoPath XPath engine uses +public final static String XPATH2_NAMESPACE_CONTEXT = XPATH2_NS_CONTEXT; + // private /** SAX features. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1180543r1=1180542r2=1180543view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Sun Oct 9 04:34:12 2011 @@ -348,7 +348,8 @@ c-fields-xpaths = c-fields-xpaths: The field value = ''{0}'' is not valid. c-general-xpath = c-general-xpath: The expression ''{0}'' is not valid with respect to the XPath subset supported by XML Schema. c-general-xpath-ns = c-general-xpath-ns: A namespace prefix in XPath expression ''{0}'' was not bound to a namespace. -c-cta-xpath = c-cta-xpath: The XPath expression ''{0}'' couldn''t compile successfully in ''{1}'' mode, during CTA evaluation. +c-cta-xpath = c-cta-xpath: The XPath expression ''{0}'' couldn''t compile successfully in ''{1}'' mode, during CTA evaluation. +c-cta-xpath-serr = c-cta-xpath-serr: The XPath expression ''{0}'' couldn''t compile successfully in ''{1}'' mode, during CTA evaluation. A static error ''{2}'' occured in the XPath expression. c-selector-xpath = c-selector-xpath: The selector value = ''{0}'' is not valid; selector xpaths cannot contain attributes. EmptyTargetNamespace = EmptyTargetNamespace: In schema document ''{0}'', the value of the ''targetNamespace'' attribute cannot be an empty string. FacetValueFromBase = FacetValueFromBase: In the declaration of type ''{0}'', value ''{1}'' of facet ''{2}'' must be from the value space of the base type, ''{3}''. 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=1180543r1=1180542r2=1180543view=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 Sun Oct 9 04:34:12 2011 @@ -20,6 +20,9 @@ package org.apache.xerces.impl.xs; import java.util.Enumeration
svn commit: r1167544 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Sat Sep 10 15:45:02 2011 New Revision: 1167544 URL: http://svn.apache.org/viewvc?rev=1167544view=rev Log: committing a schema 1.1 change: the commit made by Khaled during SVN commit 1166836, introduced a new parameter to method checkFacets (i believe, which was ValidationContext context) in class XSSimpleTypeDecl (i'm not questioning that design change, and it was good i believe). This change broke one my private test case, which does XPath2 castable as check on user defined simple types (that use constraining facets). I'm committing a new PsychoPath XPath jar which has a patch to solve this failure that I observed. For info to committers, the patch which this new jar file has, essentially has a following change, ValidationState validationState = new ValidationState(); validationState.setTypeValidatorHelper(TypeValidatorHelper.getInstance(Constants.SCHEMA_VERSION_1_1)); // this is a new call that I've introduce in this patch, which make this new PsychoPath jar compliant to Khaled's change that I've cited above The above code fragment is part of a PsychoPath engine method, that does a similar task as the Xerces method, XSTypeHelper.isStrValueValidForASimpleType(..) // at location org.apache.xerces.impl.xs.util Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1167544r1=1167543r2=1167544view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1166522 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/ impl/msg/ impl/xs/ impl/xs/alternative/ impl/xs/traversers/ jaxp/validation/ parsers/
Author: mukulg Date: Thu Sep 8 03:46:24 2011 New Revision: 1166522 URL: http://svn.apache.org/viewvc?rev=1166522view=rev Log: schema 1.1 change: as per private discussion with Sandy Gao, implementing a feature to control xpath subset vs full xpath for CTA evaluation, with xpath subset being default. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaValidatorComponentManager.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/StandardParserConfiguration.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/XML11Configuration.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java?rev=1166522r1=1166521r2=1166522view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java Thu Sep 8 03:46:24 2011 @@ -334,6 +334,9 @@ public final class Constants { /** Feature to ignore errors caused by type alternatives */ public static final String TYPE_ALTERNATIVES_CHEKING_FEATURE = validation/type-alternative-checking; +/** Feature to control full XPath 2.0 checking for CTA processing */ +public static final String CTA_FULL_XPATH_CHECKING_FEATURE = validation/cta-full-xpath-checking; + /** Feature to ignore errors caused by unparsed entities (validation/unparsed-entity-checking) */ public static final String UNPARSED_ENTITY_CHECKING_FEATURE = validation/unparsed-entity-checking; @@ -548,6 +551,7 @@ public final class Constants { TOLERATE_DUPLICATES_FEATURE, STRINGS_INTERNED_FEATURE, TYPE_ALTERNATIVES_CHEKING_FEATURE, +CTA_FULL_XPATH_CHECKING_FEATURE, }; /** Xerces properties. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1166522r1=1166521r2=1166522view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Thu Sep 8 03:46:24 2011 @@ -347,7 +347,7 @@ c-fields-xpaths = c-fields-xpaths: The field value = ''{0}'' is not valid. c-general-xpath = c-general-xpath: The expression ''{0}'' is not valid with respect to the XPath subset supported by XML Schema. c-general-xpath-ns = c-general-xpath-ns: A namespace prefix in XPath expression ''{0}'' was not bound to a namespace. -c-cta-xpath = c-cta-xpath: The expression ''{0}'' is not a valid XPath expression, for CTA evaluation. +c-cta-xpath = c-cta-xpath: The XPath expression ''{0}'' couldn''t compile successfully in ''{1}'' mode, during CTA evaluation. c-selector-xpath = c-selector-xpath: The selector value = ''{0}'' is not valid; selector xpaths cannot contain attributes. EmptyTargetNamespace = EmptyTargetNamespace: In schema document ''{0}'', the value of the ''targetNamespace'' attribute cannot be an empty string. FacetValueFromBase = FacetValueFromBase: In the declaration of type ''{0}'', value ''{1}'' of facet ''{2}'' must be from the value space of the base type, ''{3}''. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java?rev=1166522r1=1166521r2=1166522view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java Thu Sep 8 03:46:24 2011 @@ -146,6 +146,10
svn commit: r1160996 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: AbstractPsychoPathXPath2Impl.java traversers/XSDHandler.java
Author: mukulg Date: Wed Aug 24 07:49:55 2011 New Revision: 1160996 URL: http://svn.apache.org/viewvc?rev=1160996view=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=1160996r1=1160995r2=1160996view=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=1160996r1=1160995r2=1160996view=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: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1161020 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
Author: mukulg Date: Wed Aug 24 08:57:44 2011 New Revision: 1161020 URL: http://svn.apache.org/viewvc?rev=1161020view=rev Log: for the case when schema 1.1 assert xpath expressions begin with / or //, improving the description of warning message produced by Xerces. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1161020r1=1161019r2=1161020view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Wed Aug 24 08:57:44 2011 @@ -111,7 +111,7 @@ cvc-assertions-valid-union-elem = cvc-assertions-valid-union-elem: Value ''{0}'' is not facet-valid with respect to the specified assertions, on type ''{2}'' on element ''{1}''. cvc-assertions-valid-union-attr = cvc-assertions-valid-union-attr: Value ''{0}'' is not facet-valid with respect to the specified assertions, on type ''{3}'' on attribute ''{2}'/@'{1}''. cvc-xpath.3.13.4.2a = cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression (''{0}'') on the schema type ''{1}'' couldn''t compile successfully. -cvc-xpath.3.13.4.2b = cvc-xpath.3.13.4.2b: Assertion XPath expression (''{0}'') on the schema type ''{1}'' is invalid. An assert XPath expression cannot begin with / or //, since an assert tree is rooted at a parentless element. +cvc-xpath.3.13.4.2b = cvc-xpath.3.13.4.2b: An assert XPath expression such as (''{0}'') beginning with / or //, on the schema type ''{1}'', cannot yield a valid node (since an assert tree is rooted at a parentless element). #schema valid (3.X.3) - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1157313 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs: QNameDV.java XSSimpleTypeDecl.java
Author: mukulg Date: Sat Aug 13 03:55:34 2011 New Revision: 1157313 URL: http://svn.apache.org/viewvc?rev=1157313view=rev Log: doing a schema 1.1 commit. adding rules for validating values of types NCName, Name, NMToken QName with XML 1.1 rules if working in XSD 1.1 mode, else (if we would work in XSD 1.0 mode) we would use the XML 1.0 rules. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/QNameDV.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/QNameDV.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/QNameDV.java?rev=1157313r1=1157312r2=1157313view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/QNameDV.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/QNameDV.java Sat Aug 13 03:55:34 2011 @@ -19,6 +19,7 @@ package org.apache.xerces.impl.dv.xs; import org.apache.xerces.impl.dv.InvalidDatatypeValueException; import org.apache.xerces.impl.dv.ValidationContext; +import org.apache.xerces.util.XML11Char; import org.apache.xerces.util.XMLChar; import org.apache.xerces.xni.QName; import org.apache.xerces.xs.datatypes.XSQName; @@ -52,12 +53,17 @@ public class QNameDV extends TypeValidat localpart = content; } -// both prefix (if any) a nd localpart must be valid NCName -if (prefix.length() 0 !XMLChar.isValidNCName(prefix)) +boolean isSchema11 = context.getTypeValidatorHelper().isXMLSchema11(); + +// both prefix (if any) and localpart must be valid NCName +// if using XSD 1.1, use the XML 1.1 rules of validating the prefix and the local part, else use the XML 1.0 rules +if (prefix.length() 0 ((isSchema11) ? !XML11Char.isXML11ValidNCName(prefix) : !XMLChar.isValidNCName(prefix))) { throw new InvalidDatatypeValueException(cvc-datatype-valid.1.2.1, new Object[]{content, QName}); +} -if(!XMLChar.isValidNCName(localpart)) +if((isSchema11) ? !XML11Char.isXML11ValidNCName(localpart) : !XMLChar.isValidNCName(localpart)) { throw new InvalidDatatypeValueException(cvc-datatype-valid.1.2.1, new Object[]{content, QName}); +} // resove prefix to a uri, report an error if failed String uri = context.getURI(prefix); Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java?rev=1157313r1=1157312r2=1157313view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java Sat Aug 13 03:55:34 2011 @@ -37,6 +37,7 @@ import org.apache.xerces.impl.xs.util.Ob import org.apache.xerces.impl.xs.util.ShortListImpl; import org.apache.xerces.impl.xs.util.StringListImpl; import org.apache.xerces.impl.xs.util.XSObjectListImpl; +import org.apache.xerces.util.XML11Char; import org.apache.xerces.util.XMLChar; import org.apache.xerces.xni.NamespaceContext; import org.apache.xerces.xs.ShortList; @@ -2073,17 +2074,19 @@ public class XSSimpleTypeDecl implements if (fPatternType != SPECIAL_PATTERN_NONE) { boolean seenErr = false; +boolean isSchema11 = context.getTypeValidatorHelper().isXMLSchema11(); +// if using XSD 1.1, use the XML 1.1 rules of validating the NMTOKEN, Name and NCName else use the XML 1.0 rules if (fPatternType == SPECIAL_PATTERN_NMTOKEN) { // PATTERN \\c+ -seenErr = !XMLChar.isValidNmtoken(nvalue); +seenErr = (isSchema11) ? !XML11Char.isXML11ValidNmtoken(nvalue) : !XMLChar.isValidNmtoken(nvalue); } else if (fPatternType == SPECIAL_PATTERN_NAME) { -// PATTERN \\i\\c* -seenErr = !XMLChar.isValidName(nvalue); +// PATTERN \\i\\c* +seenErr = (isSchema11) ? !XML11Char.isXML11ValidName(nvalue) : !XMLChar.isValidName(nvalue); } else if (fPatternType == SPECIAL_PATTERN_NCNAME) { // PATTERN [\\i-[:]][\\c-[:]]* -seenErr = !XMLChar.isValidNCName(nvalue); +seenErr = (isSchema11) ? !XML11Char.isXML11ValidNCName(nvalue) : !XMLChar.isValidNCName(nvalue
svn commit: r1156609 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XMLSchemaValidator.java assertion/XSAssertionXPath2ValueImpl.java util/XSTypeHelper.java
Author: mukulg Date: Thu Aug 11 13:21:33 2011 New Revision: 1156609 URL: http://svn.apache.org/viewvc?rev=1156609view=rev Log: committing a schema 1.1 change. the changes committed by Khaled during the SVN commit 1156230 required these changes (otherwise some of the xsd 1.1 assertion use cases would fail). thanks to Khaled actually for improving the design with this respect. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1156609r1=1156608r2=1156609view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Thu Aug 11 13:21:33 2011 @@ -5049,11 +5049,11 @@ public class XMLSchemaValidator } /* - * Preprocessing checks for assertion evaluations for simpleType's with variety union. + * Extra checks for assertion evaluations for simpleType definitions with variety union. */ private void extraCheckForSTUnionAsserts(XSSimpleType simpleTypeDv, String content, ValidatedInfo validatedInfo, Augmentations augs) { if (simpleTypeDv.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION ((XSSimpleType) simpleTypeDv.getBaseType()).getVariety() != XSSimpleTypeDefinition.VARIETY_UNION) { -if (XSTypeHelper.isAtomicValueValidForSTUnion(simpleTypeDv.getMemberTypes(), content, validatedInfo)) { +if (XSTypeHelper.isAtomicStrValueValidForSTUnion(simpleTypeDv.getMemberTypes(), content, validatedInfo, Constants.SCHEMA_VERSION_1_1)) { fIsAssertProcessingNeededForSTUnion = false; } if (augs != null) { Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java?rev=1156609r1=1156608r2=1156609view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertionXPath2ValueImpl.java Thu Aug 11 13:21:33 2011 @@ -185,14 +185,14 @@ public class XSAssertionXPath2ValueImpl /* - * Given a string value, this method sets an XPath 2.0 typed value for variable $value in XPath dynamic context, when the value is for simpleType variety union. + * Given a string value, this method sets an XPath 2.0 typed value for variable $value in XPath dynamic context, when the value is for simpleType with variety union. */ public void setXDMTypedValueOf$valueForSTVarietyUnion(String value, XSObjectList memberTypes, DynamicContext xpath2DynamicContext) { // check member types of union in order to find that which member type can successfully validate the string value -// first, and set value of XPath2 context variable $value using the member type found as its type annotation. +// first, and set the type annotation of XPath2 context variable $value with this member type definition. for (int memTypeIdx = 0; memTypeIdx memberTypes.getLength(); memTypeIdx++) { XSSimpleType simpleTypeDv = (XSSimpleType) memberTypes.item(memTypeIdx); -if (XSTypeHelper.isValueValidForASimpleType(value, simpleTypeDv)) { +if (XSTypeHelper.isStrValueValidForASimpleType(value, simpleTypeDv, Constants.SCHEMA_VERSION_1_1)) { setXDMTypedValueOf$valueForSTVarietyAtomic(value, getXercesXSDTypeCodeFor$value(simpleTypeDv), xpath2DynamicContext); break; } @@ -291,7 +291,7 @@ public class XSAssertionXPath2ValueImpl final int memberTypesLength = memberTypes.getLength(); for (int memTypeIdx = 0; memTypeIdx memberTypesLength; memTypeIdx++) { XSSimpleType memSimpleType = (XSSimpleType) memberTypes.item(memTypeIdx); - if (XSTypeHelper.isValueValidForASimpleType(xdmItemStrValue, memSimpleType)) { + if (XSTypeHelper.isStrValueValidForASimpleType(xdmItemStrValue, memSimpleType, Constants.SCHEMA_VERSION_1_1)) { // no more memberTypes need
svn commit: r1155198 - /xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java
Author: mukulg Date: Tue Aug 9 03:41:04 2011 New Revision: 1155198 URL: http://svn.apache.org/viewvc?rev=1155198view=rev Log: schema 1.1 change: a minor change for help text (to make it consistent with other help text strings) in jaxp.SourceValidator sample. Modified: xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java?rev=1155198r1=1155197r2=1155198view=diff == --- xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java Tue Aug 9 03:41:04 2011 @@ -602,7 +602,7 @@ public class SourceValidator System.err.println( -ga | -GA Turn on/off generation of synthetic schema annotations.); System.err.println( NOTE: Not supported by all schema factories and validators.); System.err.println( -m | -MTurn on/off memory usage report); -System.err.println( -xsd11 Turn on XSD 1.1 support.); +System.err.println( -xsd11 Turn on/off XSD 1.1 support.); System.err.println( -h This help screen.); System.err.println(); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1152064 - /xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar
Author: mukulg Date: Fri Jul 29 00:49:40 2011 New Revision: 1152064 URL: http://svn.apache.org/viewvc?rev=1152064view=rev Log: committing an improved PsychoPath XPath engine JAR. there was a bug related to evaluation of reverse XPath axes references which was solved (ref, https://bugs.eclipse.org/bugs/show_bug.cgi?id=353373). Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar Modified: xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tools/org.eclipse.wst.xml.xpath2.processor_1.2.0.jar?rev=1152064r1=1152063r2=1152064view=diff == Binary files - no diff available. - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1150701 - /xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java
Author: mukulg Date: Mon Jul 25 13:54:04 2011 New Revision: 1150701 URL: http://svn.apache.org/viewvc?rev=1150701view=rev Log: improving XSSerializer utility. adding option to serialize anyAttribute/ declaration on complexType definition, and improving serialization of any/ wild-card. Modified: xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java Modified: xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java?rev=1150701r1=1150700r2=1150701view=diff == --- xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java Mon Jul 25 13:54:04 2011 @@ -187,8 +187,8 @@ public class XSSerializer { DocumentBuilder dBuilder = dbf.newDocumentBuilder(); Document document = dBuilder.newDocument(); -Element schemaDeclDomNode = document.createElementNS(XSD_LANGUAGE_URI, XSD_LANGUAGE_PREFIX + SchemaSymbols.ELT_SCHEMA); - +Element schemaDeclDomNode = document.createElementNS(XSD_LANGUAGE_URI, XSD_LANGUAGE_PREFIX + SchemaSymbols.ELT_SCHEMA); + document.appendChild(schemaDeclDomNode); // process global element declarations @@ -253,9 +253,10 @@ public class XSSerializer { addAttributeToSchemaComponent(document, attrGpDomNode, attrDecl, constraintName, constraintVal, requiredVal); } +// possible serialization of anyAttribute/ XSWildcard attrWildCard = attrGpDecl.getAttributeWildcard(); if (attrWildCard != null) { -addWildcardToSchemaComponent(document, attrGpDomNode, (XSWildcardDecl) attrWildCard, SchemaSymbols.ELT_ANYATTRIBUTE); +addWildcardToSchemaComponent(document, attrGpDomNode, (XSWildcardDecl) attrWildCard, SchemaSymbols.ELT_ANYATTRIBUTE, null, null); } schemaDeclDomNode.appendChild(attrGpDomNode); @@ -446,7 +447,7 @@ public class XSSerializer { */ private void processGlobalComplexTypeDecl(XSNamedMap globalComplexTypeDecls, Document document, Element schemaDeclDomNode) throws DOMException { -// iterating global complex types in the Schema +// iterating global complex type definitions in the Schema. // leaving out built-in Schema type, anyType from iteration for (int ctIdx = 0; ctIdx globalComplexTypeDecls.size() - 1; ctIdx++) { XSComplexTypeDecl complexTypeDecl = (XSComplexTypeDecl) globalComplexTypeDecls.item(ctIdx); @@ -701,7 +702,7 @@ public class XSSerializer { /* - * Add child content to complex type declaration. + * Add child content to complex type definition. */ private void addChildrenToComplexType(Document document, Element parentDomNode, XSComplexTypeDecl complexTypeDecl, Element complexTypeDomNode) throws DOMException { @@ -890,6 +891,12 @@ public class XSSerializer { addAttributeToSchemaComponent(document, parentDomNode, attrDecl, constraintName, constraintVal, requiredVal); } } + +// possible serialization of anyAttribute/ +XSWildcard attrWildCard = complexTypeDecl.getAttributeWildcard(); +if (attrWildCard != null) { +addWildcardToSchemaComponent(document, parentDomNode, (XSWildcardDecl) attrWildCard, SchemaSymbols.ELT_ANYATTRIBUTE, null, null); +} } // addAttributesToComplexType @@ -955,7 +962,7 @@ public class XSSerializer { } } else if (partclTerm instanceof XSWildcard) { -addWildcardToSchemaComponent(document, compositorDomNode, (XSWildcardDecl) partclTerm, SchemaSymbols.ELT_ANY); +addWildcardToSchemaComponent(document, compositorDomNode, (XSWildcardDecl) partclTerm, SchemaSymbols.ELT_ANY, minOccursParticle, maxOccursParticle); } } @@ -989,7 +996,7 @@ public class XSSerializer { } else if (partclTerm instanceof XSWildcard) { XSWildcardDecl wildCardDecl = (XSWildcardDecl) partclTerm; -addWildcardToSchemaComponent(document, allDeclDomNode, wildCardDecl, SchemaSymbols.ELT_ANY); +addWildcardToSchemaComponent(document, allDeclDomNode, wildCardDecl, SchemaSymbols.ELT_ANY, minOccursParticle, maxOccursParticle); } } @@ -1001,12 +1008,18 @@ public class XSSerializer { /* * Adding wild-card to a Schema component. */ -private void addWildcardToSchemaComponent(Document document, Element parentNode, XSWildcardDecl wildCardDecl, String wildCardType) { +private void
svn commit: r1149782 - /xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java
Author: mukulg Date: Sat Jul 23 02:13:22 2011 New Revision: 1149782 URL: http://svn.apache.org/viewvc?rev=1149782view=rev Log: making few improvements to XSSerializer (particularly removing unnecessary whitespaces and using constants from SchemaSymbols instead of writing them as literals again). Added: xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java Added: xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java?rev=1149782view=auto == --- xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java (added) +++ xerces/java/branches/xml-schema-1.1-dev/samples/xs/XSSerializer.java Sat Jul 23 02:13:22 2011 @@ -0,0 +1,1169 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package xs; + +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.xerces.impl.Constants; +import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl; +import org.apache.xerces.impl.xs.SchemaSymbols; +import org.apache.xerces.impl.xs.XMLSchemaLoader; +import org.apache.xerces.impl.xs.XSAnnotationImpl; +import org.apache.xerces.impl.xs.XSAttributeDecl; +import org.apache.xerces.impl.xs.XSAttributeGroupDecl; +import org.apache.xerces.impl.xs.XSComplexTypeDecl; +import org.apache.xerces.impl.xs.XSElementDecl; +import org.apache.xerces.impl.xs.XSGroupDecl; +import org.apache.xerces.impl.xs.XSModelGroupImpl; +import org.apache.xerces.impl.xs.XSWildcardDecl; +import org.apache.xerces.impl.xs.identity.Field; +import org.apache.xerces.impl.xs.identity.IdentityConstraint; +import org.apache.xerces.impl.xs.identity.KeyRef; +import org.apache.xerces.impl.xs.identity.Selector; +import org.apache.xerces.impl.xs.util.XSTypeHelper; +import org.apache.xerces.xs.StringList; +import org.apache.xerces.xs.XSAttributeUse; +import org.apache.xerces.xs.XSComplexTypeDefinition; +import org.apache.xerces.xs.XSConstants; +import org.apache.xerces.xs.XSElementDeclaration; +import org.apache.xerces.xs.XSFacet; +import org.apache.xerces.xs.XSIDCDefinition; +import org.apache.xerces.xs.XSModel; +import org.apache.xerces.xs.XSModelGroup; +import org.apache.xerces.xs.XSMultiValueFacet; +import org.apache.xerces.xs.XSNamedMap; +import org.apache.xerces.xs.XSObject; +import org.apache.xerces.xs.XSObjectList; +import org.apache.xerces.xs.XSParticle; +import org.apache.xerces.xs.XSSimpleTypeDefinition; +import org.apache.xerces.xs.XSTerm; +import org.apache.xerces.xs.XSTypeDefinition; +import org.apache.xerces.xs.XSValue; +import org.apache.xerces.xs.XSWildcard; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.bootstrap.DOMImplementationRegistry; +import org.w3c.dom.ls.DOMImplementationLS; +import org.w3c.dom.ls.LSOutput; +import org.w3c.dom.ls.LSSerializer; +import org.xml.sax.InputSource; + +/** + * XSModel serialization utility. + * This utility serializes the Xerces XSModel into lexical, XSD syntax. + * + * @author Mukul Gandhi, IBM + * @version $Id$ + */ +public class XSSerializer { + +private static final String XSD_LANGUAGE_URI = SchemaSymbols.URI_SCHEMAFORSCHEMA; +private static final String XML_SCHEMA_VERSION = Constants.XERCES_PROPERTY_PREFIX + Constants.XML_SCHEMA_VERSION_PROPERTY; +private static String XSD_LANGUAGE_PREFIX = xs:; + + +/* + * Main method + * + * An entry point to test this utility. + * + * The XSModel could be synthesized by any means (for example, by direct + * API calls to Xerces Schema API, methods) -- in which case, the method + * serialize will be used directly, passing in the XSModel object. + */ +public static void main(String[] args) { + +if (args.length == 0 || args.length 5) { +printUsage(); +System.exit(-1); +} + +// the last command line argument must be a schema URI +String schemaUri = args[args.length - 1]; + +// iterate other command line
svn commit: r1148437 - /xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Tue Jul 19 16:33:35 2011 New Revision: 1148437 URL: http://svn.apache.org/viewvc?rev=1148437view=rev Log: committing fix for the JIRA issue XERCESJ-1518 Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java?rev=1148437r1=1148436r2=1148437view=diff == --- xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java (original) +++ xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java Tue Jul 19 16:33:35 2011 @@ -69,6 +69,7 @@ import org.apache.xerces.util.StAXInputS import org.apache.xerces.util.StAXLocationWrapper; import org.apache.xerces.util.SymbolHash; import org.apache.xerces.util.SymbolTable; +import org.apache.xerces.util.XMLChar; import org.apache.xerces.util.URI.MalformedURIException; import org.apache.xerces.util.XMLSymbols; import org.apache.xerces.xni.QName; @@ -1269,6 +1270,7 @@ public class XSDHandler { String qName = currSchemaDoc.fTargetNamespace == null ? ,+lName: currSchemaDoc.fTargetNamespace +,+lName; +qName = XMLChar.trim(qName); String componentType = DOMUtil.getLocalName(redefineComp); if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) { checkForDuplicateNames(qName, ATTRIBUTEGROUP_TYPE, fUnparsedAttributeGroupRegistry, fUnparsedAttributeGroupRegistrySub, redefineComp, currSchemaDoc); @@ -1313,6 +1315,7 @@ public class XSDHandler { String qName = currSchemaDoc.fTargetNamespace == null? ,+lName: currSchemaDoc.fTargetNamespace +,+lName; +qName = XMLChar.trim(qName); String componentType = DOMUtil.getLocalName(globalComp); if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTE)) { - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1148440 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Author: mukulg Date: Tue Jul 19 16:34:17 2011 New Revision: 1148440 URL: http://svn.apache.org/viewvc?rev=1148440view=rev Log: committing fix for the JIRA issue XERCESJ-1518 Modified: 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/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=1148440r1=1148439r2=1148440view=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 Tue Jul 19 16:34:17 2011 @@ -77,6 +77,7 @@ import org.apache.xerces.util.StAXLocati import org.apache.xerces.util.SymbolHash; import org.apache.xerces.util.SymbolTable; import org.apache.xerces.util.URI.MalformedURIException; +import org.apache.xerces.util.XMLChar; import org.apache.xerces.util.XMLSymbols; import org.apache.xerces.xni.QName; import org.apache.xerces.xni.XNIException; @@ -1380,6 +1381,7 @@ public class XSDHandler { String qName = currSchemaDoc.fTargetNamespace == null ? ,+lName: currSchemaDoc.fTargetNamespace +,+lName; +qName = XMLChar.trim(qName); String componentType = DOMUtil.getLocalName(redefineComp); if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) { checkForDuplicateNames(qName, ATTRIBUTEGROUP_TYPE, fUnparsedAttributeGroupRegistry, fUnparsedAttributeGroupRegistrySub, redefineComp, currSchemaDoc); @@ -1436,6 +1438,7 @@ public class XSDHandler { String qName = currSchemaDoc.fTargetNamespace == null? ,+lName: currSchemaDoc.fTargetNamespace +,+lName; +qName = XMLChar.trim(qName); if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTE)) { checkForDuplicateNames(qName, ATTRIBUTE_TYPE, fUnparsedAttributeRegistry, fUnparsedAttributeRegistrySub, globalComp, currSchemaDoc); } - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1142631 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
Author: mukulg Date: Mon Jul 4 11:40:41 2011 New Revision: 1142631 URL: http://svn.apache.org/viewvc?rev=1142631view=rev Log: doing a small fix to schema 1.1 type alternative implementation. if xpathDefaultNamespace is not present on xs:alternative, the implementation was not taking it's value from the ancestor xs:schema node (if it was present there). this commit solves this problem. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java?rev=1142631r1=1142630r2=1142631view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java Mon Jul 4 11:40:41 2011 @@ -83,7 +83,7 @@ class XSDTypeAlternativeTraverser extend Object[] attrValues = fAttrChecker.checkAttributes(altElement, false, schemaDoc); QName typeAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_TYPE]; String testStr = (String) attrValues[XSAttributeChecker.ATTIDX_XPATH]; -String xpathNS = (String) attrValues[XSAttributeChecker.ATTIDX_XPATHDEFAULTNS]; +String xpathDefaultNS = (String) attrValues[XSAttributeChecker.ATTIDX_XPATHDEFAULTNS]; // get 'annotation' Element childNode = DOMUtil.getFirstChildElement(altElement); @@ -183,7 +183,7 @@ class XSDTypeAlternativeTraverser extend reportSchemaError(s4s-elt-must-match.1, new Object[]{type alternative, (annotation?, (simpleType | complexType)?), DOMUtil.getLocalName(childNode)}, childNode); } -// create type alternative +// create type alternative component XSTypeAlternativeImpl typeAlternative = new XSTypeAlternativeImpl(element.fName, alternativeType, annotations); // now look for other optional attributes like test and xpathDefaultNamespace @@ -214,9 +214,12 @@ class XSDTypeAlternativeTraverser extend // REVISIT : is using Document.getDocumentURI() correct to retrieve base URI in every case, for type alternatives? typeAlternative.setBaseURI(fXsdHandler.getDocumentURI()); -if (xpathNS != null) { +if (xpathDefaultNS == null) { +xpathDefaultNS = schemaDoc.fXpathDefaultNamespace; +} +if (xpathDefaultNS != null) { //set the xpathDefaultNamespace attribute value -typeAlternative.setXPathDefauleNamespace(xpathNS); +typeAlternative.setXPathDefauleNamespace(xpathDefaultNS); } grammar.addTypeAlternative(element, typeAlternative); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1136825 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XMLSchemaValidator.java identity/Field.java identity/Selector.java identity/XPathMatcher.java traverse
Author: mukulg Date: Fri Jun 17 09:37:42 2011 New Revision: 1136825 URL: http://svn.apache.org/viewvc?rev=1136825view=rev Log: committing a schema 1.1 fix. it seems that implementation of attribute xpathDefaultNamespace for xs:selector xs:field in IDC constraints was incomplete (the evaluation of this wasn't occurring, but traverser was fine). i'm committing an improved implementation of this functionality. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Field.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Selector.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/XPathMatcher.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1136825r1=1136824r2=1136825view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Fri Jun 17 09:37:42 2011 @@ -1709,6 +1709,9 @@ public class XMLSchemaValidator ValueStore valueStore = fValueStoreCache.getValueStoreFor(field.getIdentityConstraint(), initialDepth); XPathMatcher matcher = field.createMatcher(valueStore); +if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { +matcher.setXPathDefaultNamespace(field.getXPathDefaultNamespace()); +} fMatcherStack.addMatcher(matcher); matcher.startDocumentFragment(); return matcher; @@ -1734,6 +1737,9 @@ public class XMLSchemaValidator if (selector == null) return; XPathMatcher matcher = selector.createMatcher(activator, fElementDepth); +if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { + matcher.setXPathDefaultNamespace(selector.getXPathDefaultNamespace()); +} fMatcherStack.addMatcher(matcher); matcher.startDocumentFragment(); } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Field.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Field.java?rev=1136825r1=1136824r2=1136825view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Field.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Field.java Fri Jun 17 09:37:42 2011 @@ -47,16 +47,19 @@ public class Field { /** Identity constraint. */ protected final IdentityConstraint fIdentityConstraint; + +/** XPath default namespace. */ +protected String fXpathDefaultNamespace; // // Constructors // /** Constructs a field. */ -public Field(Field.XPath xpath, - IdentityConstraint identityConstraint) { +public Field(Field.XPath xpath, IdentityConstraint identityConstraint, String xpathDefaultNamespace) { fXPath = xpath; fIdentityConstraint = identityConstraint; +fXpathDefaultNamespace = xpathDefaultNamespace; } // init(Field.XPath,IdentityConstraint) // @@ -88,6 +91,11 @@ public class Field { public String toString() { return fXPath.toString(); } // toString():String + +/** Return value of xpathDefaultNamespace. */ +public String getXPathDefaultNamespace() { +return fXpathDefaultNamespace; +} // // Classes Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Selector.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Selector.java?rev=1136825r1=1136824r2=1136825view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Selector.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/identity/Selector.java Fri Jun 17 09:37:42 2011 @@ -49,16 +49,19 @@ public class Selector { // the Identity constraint we're the matcher for. Only // used for selectors! protected IdentityConstraint fIDConstraint; + +/** XPath default namespace. */ +protected String fXpathDefaultNamespace; // // Constructors // /** Constructs
svn commit: r1136880 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
Author: mukulg Date: Fri Jun 17 13:40:39 2011 New Revision: 1136880 URL: http://svn.apache.org/viewvc?rev=1136880view=rev Log: cosmetic improvement to javadocs (really minor, and sorry if this commit is annoying). Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java?rev=1136880r1=1136879r2=1136880view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java Fri Jun 17 13:40:39 2011 @@ -192,7 +192,7 @@ class XSDAbstractIDConstraintTraverser e } // traverseIdentityConstraint(IdentityConstraint,Element, XSDocumentInfo) /* - * Get the value of xpathDefaultNamespace attribute for xs:selector or xs:field + * Get the value of xpathDefaultNamespace attribute for xs:selector or xs:field. */ private String getXPathDefaultNamespace(Object[] attrValues, XSDocumentInfo schemaDoc) { String xpathDefaultNamespace = ((String)attrValues[XSAttributeChecker.ATTIDX_XPATHDEFAULTNS]); - To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org
svn commit: r1129482 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl: Constants.java xs/XMLSchemaValidator.java xs/XSDTypeAlternativeValidator.java
Author: mukulg Date: Tue May 31 04:00:04 2011 New Revision: 1129482 URL: http://svn.apache.org/viewvc?rev=1129482view=rev Log: improving [type alternative] PSVI implementation a little bit. we don't seem to need another Augmentations object, just for this need. readjusting the logic a little bit has probably made the design for this better. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java?rev=1129482r1=1129481r2=1129482view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java Tue May 31 04:00:04 2011 @@ -450,9 +450,6 @@ public final class Constants { /** Attribute PSVI is stored in augmentations using string ATTRIBUTE_PSVI */ public final static String ATTRIBUTE_PSVI = ATTRIBUTE_PSVI; -/** [type alternative] PSVI is stored in augmentations using string TYPE_ALTERNATIVE */ -public final static String TYPE_ALTERNATIVE = TYPE_ALTERNATIVE; - /** * Boolean indicating whether an attribute is declared in the DTD is stored * in augmentations using the string ATTRIBUTE_DECLARED. The absence of this Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1129482r1=1129481r2=1129482view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Tue May 31 04:00:04 2011 @@ -2206,12 +2206,10 @@ public class XMLSchemaValidator //process type alternatives if (fTypeAlternativesChecking fCurrentElemDecl != null) { - Augmentations typeAltAugs = new AugmentationsImpl(); - XSTypeDefinition currentType = fTypeAlternativeValidator.getCurrentType(fCurrentElemDecl, element, attributes, fInheritableAttrList, typeAltAugs); - if (currentType != null) { - fCurrentType = currentType; + fTypeAlternative = fTypeAlternativeValidator.getTypeAlternative(fCurrentElemDecl, element, attributes, fInheritableAttrList); + if (fTypeAlternative != null) { + fCurrentType = fTypeAlternative.getTypeDefinition(); } - fTypeAlternative = (XSTypeAlternative)typeAltAugs.getItem(Constants.TYPE_ALTERNATIVE); } // check if we should be ignoring xsi:type on this element Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java?rev=1129482r1=1129481r2=1129482view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java Tue May 31 04:00:04 2011 @@ -19,18 +19,15 @@ package org.apache.xerces.impl.xs; import java.util.Vector; -import org.apache.xerces.impl.Constants; import org.apache.xerces.impl.xs.alternative.Test; import org.apache.xerces.impl.xs.alternative.XSTypeAlternativeImpl; import org.apache.xerces.impl.xs.util.XSTypeHelper; import org.apache.xerces.util.XMLAttributesImpl; -import org.apache.xerces.xni.Augmentations; import org.apache.xerces.xni.QName; import org.apache.xerces.xni.XMLAttributes; import org.apache.xerces.xs.AttributePSVI; import org.apache.xerces.xs.XSAttributeDeclaration; import org.apache.xerces.xs.XSTypeAlternative; -import org.apache.xerces.xs.XSTypeDefinition; /** * An XML Schema validator subcomponent handling type alternative processing. @@ -53,12 +50,11 @@ public class XSDTypeAlternativeValidator /* - * Determine the schema type applicable for an element declaration, using type alternative information. + * Determine the schema type applicable (represented as XSTypeAlternative component) for an element declaration, using type alternative
svn commit: r1128843 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: dom/PSVIElementNSImpl.java impl/xs/ElementPSVImpl.java impl/xs/XMLAssertPsychopathXPath2Impl.java impl/xs/XMLS
Author: mukulg Date: Sun May 29 09:18:06 2011 New Revision: 1128843 URL: http://svn.apache.org/viewvc?rev=1128843view=rev Log: committing implementation of [failed assertions] schema 1.1 PSVI property. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/ElementPSVI.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java?rev=1128843r1=1128842r2=1128843view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java Sun May 29 09:18:06 2011 @@ -109,7 +109,10 @@ public class PSVIElementNSImpl extends E protected XSModel fSchemaInformation = null; /** inherited attributes */ -protected ObjectList fInheritedAttributes = null; +protected ObjectList fInheritedAttributes = null; + +/** failed assertions */ +protected ObjectList fFailedAssertions = null; // // ElementPSVI methods @@ -285,6 +288,19 @@ public class PSVIElementNSImpl extends E } /** + * Failed assertions. + * + * @return failed assertions list, or an empty list + * if none of assertions failed. + */ +public ObjectList getFailedAssertions() { +if (fFailedAssertions != null) { +return fFailedAssertions; +} +return ObjectListImpl.EMPTY_LIST; +} + +/** * Copy PSVI properties from another psvi item. * * @param elem the source of element PSVI items @@ -309,7 +325,8 @@ public class PSVIElementNSImpl extends E } this.fSpecified = elem.getIsSchemaSpecified(); this.fNil = elem.getNil(); -this.fInheritedAttributes = elem.getInheritedAttributes(); +this.fInheritedAttributes = elem.getInheritedAttributes(); +this.fFailedAssertions = elem.getFailedAssertions(); } /* (non-Javadoc) Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java?rev=1128843r1=1128842r2=1128843view=diff == --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java Sun May 29 09:18:06 2011 @@ -91,7 +91,10 @@ public class ElementPSVImpl implements E protected boolean fIsConstant; /** inherited attributes **/ -protected ObjectList fInheritedAttributes = null; +protected ObjectList fInheritedAttributes = null; + +/** failed assertions **/ +protected ObjectList fFailedAssertions = null; public ElementPSVImpl() {} @@ -106,6 +109,7 @@ public class ElementPSVImpl implements E fValidity = elementPSVI.getValidity(); fValidationContext = elementPSVI.getValidationContext(); fInheritedAttributes = elementPSVI.getInheritedAttributes(); +fFailedAssertions = elementPSVI.getFailedAssertions(); if (elementPSVI instanceof ElementPSVImpl) { final ElementPSVImpl elementPSVIImpl = (ElementPSVImpl) elementPSVI; fErrors = (elementPSVIImpl.fErrors != null) ? @@ -337,6 +341,19 @@ public class ElementPSVImpl implements E } /** + * Failed assertions. + * + * @return failed assertions list, or an empty list + * if none of assertions failed. + */ +public ObjectList getFailedAssertions() { +if (fFailedAssertions != null) { +return fFailedAssertions; +} +return ObjectListImpl.EMPTY_LIST; +} + +/** * Reset() should be called in validator startElement(..) method. */ public void reset() { @@ -351,6 +368,7 @@ public class ElementPSVImpl implements E fValidationContext = null; fValue.reset(); fInheritedAttributes = null; +fFailedAssertions = null; } public void copySchemaInformationTo(ElementPSVImpl target) { Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java URL