You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/09/16 20:26:12 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/identity Field.java Selector.java XPathMatcher.java
sandygao 2002/09/16 11:26:12
Modified: java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
java/src/org/apache/xerces/impl/xs/identity Field.java
Selector.java XPathMatcher.java
Log:
Modified the identity constraint code so that it doesn't depend on PSVI.
Revision Changes Path
1.96 +5 -2 xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Index: XMLSchemaValidator.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- XMLSchemaValidator.java 16 Sep 2002 17:44:57 -0000 1.95
+++ XMLSchemaValidator.java 16 Sep 2002 18:26:09 -0000 1.96
@@ -2025,7 +2025,10 @@
int oldCount = fMatcherStack.getMatcherCount();
for (int i = oldCount - 1; i >= 0; i--) {
XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
- matcher.endElement(element, fCurrentElemDecl, fCurrentPSVI);
+ matcher.endElement(element, fCurrentElemDecl,
+ defaultValue == null ?
+ fValidatedInfo.normalizedValue :
+ fCurrentElemDecl.fDefault.normalizedValue);
}
if (fMatcherStack.size() > 0) {
fMatcherStack.popContext();
1.8 +8 -8 xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Field.java
Index: Field.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Field.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Field.java 26 Aug 2002 14:46:47 -0000 1.7
+++ Field.java 16 Sep 2002 18:26:11 -0000 1.8
@@ -172,12 +172,12 @@
// order to handle selectors such as "@attr" that
// select the attribute because the fields could be
// relative to the selector element. -Ac
- // Unless xpath starts with a descendant node -Achille Fokoue
+ // Unless xpath starts with a descendant node -Achille Fokoue
// ... or a / or a . - NG
- super(((xpath.trim().startsWith("/") ||xpath.trim().startsWith("."))?
- xpath:"./"+xpath),
+ super(((xpath.trim().startsWith("/") ||xpath.trim().startsWith("."))?
+ xpath:"./"+xpath),
symbolTable, context);
-
+
} // <init>(String,SymbolTable,NamespacesContext)
} // class XPath
@@ -228,7 +228,7 @@
mayMatch = false;
} // matched(String)
- protected void handleContent(XSElementDecl eDecl, ElementPSVI ePSVI) {
+ protected void handleContent(XSElementDecl eDecl, String value) {
// REVISIT: make sure type is simple!
XSSimpleType val=null;
@@ -252,13 +252,13 @@
fStore.reportError(code, new Object[]{fIdentityConstraint.getName(), name});
return;
}
- fMatchedString = ePSVI.getSchemaNormalizedValue();
+ fMatchedString = value;
if(eDecl != null) {
matched(fMatchedString, val, (eDecl.getIsNillable()));
} else {
matched(fMatchedString, val, false);
}
- } // handleContent(XSElementDecl, ElementPSVI)
+ } // handleContent(XSElementDecl, String)
} // class Matcher
1.11 +4 -4 xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Selector.java
Index: Selector.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/identity/Selector.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Selector.java 29 Aug 2002 23:25:24 -0000 1.10
+++ Selector.java 16 Sep 2002 18:26:11 -0000 1.11
@@ -275,8 +275,8 @@
} // startElement(QName,XMLAttrList,int)
- public void endElement(QName element, XSElementDecl eDecl, ElementPSVI ePSVI) {
- super.endElement(element, eDecl, ePSVI);
+ public void endElement(QName element, XSElementDecl eDecl, String value) {
+ super.endElement(element, eDecl, value);
if (fElementDepth-- == fMatchedDepth) {
fMatchedDepth = -1;
fFieldActivator.endValueScopeFor(fIdentityConstraint, fInitialDepth);
1.13 +5 -5 xml-xerces/java/src/org/apache/xerces/impl/xs/identity/XPathMatcher.java
Index: XPathMatcher.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/identity/XPathMatcher.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XPathMatcher.java 3 Sep 2002 17:55:32 -0000 1.12
+++ XPathMatcher.java 16 Sep 2002 18:26:11 -0000 1.13
@@ -205,8 +205,8 @@
// a place-holder method; to be overridden by subclasses
// that care about matching element content.
- protected void handleContent(XSElementDecl eDecl, ElementPSVI ePSVI) {
- } // handleContent(XSElementDecl, ElementPSVI)
+ protected void handleContent(XSElementDecl eDecl, String value) {
+ } // handleContent(XSElementDecl, String)
/**
* This method is called when the XPath handler matches the
@@ -451,7 +451,7 @@
*
* @throws SAXException Thrown by handler to signal an error.
*/
- public void endElement(QName element, XSElementDecl eDecl, ElementPSVI ePSVI) {
+ public void endElement(QName element, XSElementDecl eDecl, String value) {
if (DEBUG_METHODS2) {
System.out.println(toString()+"#endElement("+
"element={"+element+"},"+
@@ -478,7 +478,7 @@
// match element content. This permits
// them a way to override this to do nothing
// and hopefully save a few operations.
- handleContent(eDecl, ePSVI);
+ handleContent(eDecl, value);
fMatched[i] = 0;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org