This is an automated email from the ASF dual-hosted git repository.

mukulg pushed a commit to branch xml-schema-1.1-dev
in repository https://gitbox.apache.org/repos/asf/xerces-j.git


The following commit(s) were added to refs/heads/xml-schema-1.1-dev by this 
push:
     new a251e18f5 committing fix for jira issue XERCESJ-1765
a251e18f5 is described below

commit a251e18f553d426326daf1cd6b6015be981970b5
Author: Mukul Gandhi <[email protected]>
AuthorDate: Sun Jul 14 22:06:44 2024 +0530

    committing fix for jira issue XERCESJ-1765
---
 .classpath                                                   |  1 +
 .settings/org.eclipse.jdt.core.prefs                         | 12 ++++++------
 src/org/apache/xerces/impl/Constants.java                    |  3 ++-
 src/org/apache/xerces/impl/xs/XMLAssertXPath2EngineImpl.java |  8 +++++++-
 src/org/apache/xerces/impl/xs/XSDAssertionValidator.java     |  1 +
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/.classpath b/.classpath
index c14ea68c6..c4347a313 100644
--- a/.classpath
+++ b/.classpath
@@ -8,6 +8,7 @@
        <classpathentry kind="lib" path="tools/icu4j.jar"/>
        <classpathentry kind="lib" path="tools/resolver.jar"/>
        <classpathentry kind="lib" path="tools/junit.jar"/>
+       <classpathentry kind="lib" 
path="tools/org.eclipse.wst.xml.xpath2.processor_1.2.1.jar"/>
        <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/.settings/org.eclipse.jdt.core.prefs 
b/.settings/org.eclipse.jdt.core.prefs
index bfab4f073..bb4af5233 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,15 +1,15 @@
-#Thu Feb 19 19:22:46 EST 2009
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.3
+org.eclipse.jdt.core.compiler.compliance=1.8
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/src/org/apache/xerces/impl/Constants.java 
b/src/org/apache/xerces/impl/Constants.java
index c14c94a56..debe48aac 100644
--- a/src/org/apache/xerces/impl/Constants.java
+++ b/src/org/apache/xerces/impl/Constants.java
@@ -500,8 +500,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 Eclipse XPath 2.0 engine uses
+    // Constants to support XPath 2.0 processor uses
     public final static String XPATH2_NAMESPACE_CONTEXT = "XPATH2_NS_CONTEXT";
+    public final static String XML_BASE_URI = "XML_BASE_URI";
     public final static String IS_CTA_EVALUATOR = "CTA-EVALUATOR";
     
     // private
diff --git a/src/org/apache/xerces/impl/xs/XMLAssertXPath2EngineImpl.java 
b/src/org/apache/xerces/impl/xs/XMLAssertXPath2EngineImpl.java
index 02dba2c9d..ad19b13e6 100644
--- a/src/org/apache/xerces/impl/xs/XMLAssertXPath2EngineImpl.java
+++ b/src/org/apache/xerces/impl/xs/XMLAssertXPath2EngineImpl.java
@@ -160,6 +160,12 @@ public class XMLAssertXPath2EngineImpl extends 
XMLAssertAdapter {
         
         if (fCurrentAssertDomNode == null) {
             fCurrentAssertDomNode = new PSVIElementNSImpl((CoreDocumentImpl) 
fAssertDocument, element.uri, element.rawname);
+            Object xmlBaseUri = fAssertParams.get(Constants.XML_BASE_URI);
+            if (xmlBaseUri != null) {
+               PSVIAttrNSImpl attrNode = new 
PSVIAttrNSImpl((PSVIDocumentImpl)fAssertDocument, 
"http://www.w3.org/XML/1998/namespace";, "xml:base", "base");
+               
attrNode.setNodeValue((fAssertParams.get(Constants.XML_BASE_URI)).toString());
+               fCurrentAssertDomNode.setAttributeNode(attrNode);
+            }
             fAssertDocument.appendChild(fCurrentAssertDomNode);
         } else {
             Element elem = new PSVIElementNSImpl((CoreDocumentImpl) 
fAssertDocument, element.uri, element.rawname);
@@ -177,7 +183,7 @@ public class XMLAssertXPath2EngineImpl extends 
XMLAssertAdapter {
                attrNode.setPSVI(attrPSVI);
             }
             fCurrentAssertDomNode.setAttributeNode(attrNode);
-        }
+        }                
 
         if (augs != null) {
             // if we have assertions applicable to this element, store the 
element reference and the assertions 
diff --git a/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java 
b/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java
index 072d53d75..7b714588d 100644
--- a/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java
+++ b/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java
@@ -184,6 +184,7 @@ public class XSDAssertionValidator {
             xpathNamespaceContext = new NamespaceSupport();     
         }
         assertProcessorParams.put(Constants.XPATH2_NAMESPACE_CONTEXT, 
xpathNamespaceContext);
+        assertProcessorParams.put(Constants.XML_BASE_URI, 
fXmlSchemaValidator.fLocator.getExpandedSystemId());
         // initialize the assertions processor
         initializeAssertProcessor(assertProcessorParams);
     } // constructAssertProcessor


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to