venu 2003/11/14 01:25:13
Modified: java/src/org/apache/xerces/dom DOMNormalizer.java
java/src/org/apache/xerces/impl RevalidationHandler.java
java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
Log:
Committing schemaLocation patch submitted by kohosuke kawaguchi.
Revision Changes Path
1.38 +4 -3 xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java
Index: DOMNormalizer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- DOMNormalizer.java 14 Nov 2003 02:44:08 -0000 1.37
+++ DOMNormalizer.java 14 Nov 2003 09:25:12 -0000 1.38
@@ -234,9 +234,10 @@
fErrorHandler = (DOMErrorHandler)
fConfiguration.getParameter("error-handler");
if (fValidationHandler != null) {
- fValidationHandler.setBaseURI(fDocument.fDocumentURI);
fValidationHandler.setDocumentHandler(this);
- fValidationHandler.startDocument(null, fDocument.encoding,
fNamespaceContext, null);
+ fValidationHandler.startDocument(
+ new SimpleLocator(fDocument.fDocumentURI,
fDocument.fDocumentURI,
+ -1, -1 ), fDocument.encoding,
fNamespaceContext, null);
}
try {
1.5 +1 -8
xml-xerces/java/src/org/apache/xerces/impl/RevalidationHandler.java
Index: RevalidationHandler.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/RevalidationHandler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RevalidationHandler.java 8 May 2003 20:11:54 -0000 1.4
+++ RevalidationHandler.java 14 Nov 2003 09:25:12 -0000 1.5
@@ -69,13 +69,6 @@
public interface RevalidationHandler extends XMLDocumentFilter {
/**
- * Set the base URI of the document
- *
- * @param base
- */
- public void setBaseURI(String base);
-
- /**
* Character content.
*
* @param data The character data.
1.149 +19 -10
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.148
retrieving revision 1.149
diff -u -r1.148 -r1.149
--- XMLSchemaValidator.java 12 Nov 2003 23:17:33 -0000 1.148
+++ XMLSchemaValidator.java 14 Nov 2003 09:25:12 -0000 1.149
@@ -316,6 +316,11 @@
/** Symbol table. */
protected SymbolTable fSymbolTable;
+
+ /**
+ * While parsing a document, keep the location of the document.
+ */
+ private XMLLocator fLocator;
/**
* A wrapper of the standard error reporter. We'll store all schema errors
@@ -443,8 +448,8 @@
protected final XSDDescription fXSDDescription = new XSDDescription();
protected final Hashtable fLocationPairs = new Hashtable();
- /** Base URI for the DOM revalidation*/
- protected String fBaseURI = null;
+
+
// handlers
@@ -607,6 +612,7 @@
fValidationState.setNamespaceSupport(namespaceContext);
fState4XsiType.setNamespaceSupport(namespaceContext);
fState4ApplyDefault.setNamespaceSupport(namespaceContext);
+ fLocator = locator;
handleStartDocument(locator, encoding);
// call handlers
@@ -845,6 +851,7 @@
if (fDocumentHandler != null) {
fDocumentHandler.endDocument(augs);
}
+ fLocator = null;
} // endDocument(Augmentations)
@@ -852,9 +859,9 @@
// DOMRevalidationHandler methods
//
- public void setBaseURI(String base) {
- fBaseURI = base;
- }
+
+
+
public boolean characterData(String data, Augmentations augs) {
@@ -1267,7 +1274,7 @@
fInCDATA = false;
fMatcherStack.clear();
- fBaseURI = null;
+
// get error reporter
fXSIErrorReporter.reset((XMLErrorReporter)
componentManager.getProperty(ERROR_REPORTER));
@@ -2315,9 +2322,9 @@
fXSDDescription.fEnclosedElementName = enclosingElement;
fXSDDescription.fTriggeringComponent = triggeringComponet;
fXSDDescription.fAttributes = attributes;
- if (fBaseURI != null) {
- fXSDDescription.setBaseSystemId(fBaseURI);
- }
+ if (fLocator != null) {
+ fXSDDescription.setBaseSystemId(fLocator.getExpandedSystemId());
+ }
String[] temp = null;
Object locationArray =
@@ -2748,6 +2755,8 @@
attrPSVI.fActualValue = fValidatedInfo.actualValue;
attrPSVI.fActualValueType = fValidatedInfo.actualValueType;
attrPSVI.fItemValueTypes = fValidatedInfo.itemValueTypes;
+
+
// PSVI: validation attempted:
attrPSVI.fValidationAttempted = AttributePSVI.VALIDATION_FULL;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]