I just committed some changes to the DOMAddLines sample to bring it up
to DOM L3.

Here's the change that I'd like to make to DOMParser to get the
current-element-node property working again  -- I didn't want to just
commit it because it puts some property handling code in a concrete
parser class.

Please comment on whether you think that this is a good change or not.

Ted


Index: DOMParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMParser.java,v
retrieving revision 1.57
diff -u -r1.57 DOMParser.java
--- DOMParser.java      17 Jan 2002 23:54:58 -0000      1.57
+++ DOMParser.java      22 Jan 2002 20:05:54 -0000
@@ -61,6 +61,7 @@
 import java.io.IOException;
 import java.io.Reader;
 
+import org.apache.xerces.impl.Constants;
 import org.apache.xerces.xni.grammars.XMLGrammarPool;
 import org.apache.xerces.util.EntityResolverWrapper;
 import org.apache.xerces.util.ErrorHandlerWrapper;
@@ -472,6 +473,10 @@
 
     } // setProperty(String,Object)
 
+    /** Property identifier: Current Element. */
+    protected static final String CURRENT_ELEMENT_PROPERTY_ID = 
+        Constants.XERCES_PROPERTY_PREFIX + Constants.CURRENT_ELEMENT_NODE_PROPERTY;
+
     /**
      * Query the value of a property.
      *
@@ -489,7 +494,11 @@
     public Object getProperty(String propertyId)
         throws SAXNotRecognizedException, SAXNotSupportedException {
 
-        try {
+               if (propertyId.equals(CURRENT_ELEMENT_PROPERTY_ID)) {
+                       return fCurrentNode;
+               }
+
+       try {
             return fConfiguration.getProperty(propertyId);
         }
         catch (XMLConfigurationException e) {

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to