You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2005/05/25 07:00:26 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/jaxp/validation DOMValidatorHelper.java
mrglavas 2005/05/24 22:00:26
Modified: java/src/org/apache/xerces/jaxp/validation
DOMValidatorHelper.java
Log:
Set system identifier on the locator. This is not only useful for
errors but also provides a base URI for any schema location hints
in the document.
Revision Changes Path
1.2 +6 -4 xml-xerces/java/src/org/apache/xerces/jaxp/validation/DOMValidatorHelper.java
Index: DOMValidatorHelper.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/validation/DOMValidatorHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMValidatorHelper.java 22 May 2005 20:08:07 -0000 1.1
+++ DOMValidatorHelper.java 25 May 2005 05:00:26 -0000 1.2
@@ -37,7 +37,6 @@
import org.apache.xerces.util.XMLSymbols;
import org.apache.xerces.xni.NamespaceContext;
import org.apache.xerces.xni.QName;
-import org.apache.xerces.xni.XMLLocator;
import org.apache.xerces.xni.XMLString;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLParseException;
@@ -115,8 +114,8 @@
/** Component manager. **/
private XMLSchemaValidatorComponentManager fComponentManager;
- /** REVISIT: Dummy locator object for DOM. **/
- private final XMLLocator fXMLLocator = new SimpleLocator(null, null, -1, -1, -1);
+ /** Simple Locator. **/
+ private final SimpleLocator fXMLLocator = new SimpleLocator(null, null, -1, -1, -1);
/** DOM document handler. **/
private DOMDocumentHandler fDOMValidatorHandler;
@@ -164,6 +163,9 @@
if (node != null) {
fComponentManager.reset();
fValidationManager.setEntityState(this);
+ String systemId = domSource.getSystemId();
+ fXMLLocator.setLiteralSystemId(systemId);
+ fXMLLocator.setExpandedSystemId(systemId);
fErrorReporter.setDocumentLocator(fXMLLocator);
try {
// regardless of what type of node this is, fire start and end document events
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org