DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6538>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6538 wrong id for property current-element-node Summary: wrong id for property current-element-node Product: Xerces2-J Version: 2.0.0 Platform: All OS/Version: All Status: NEW Severity: Major Priority: Other Component: DOM AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Hi, According to Xerces documentation, id for current-element-node property should be : http://apache.org/xml/properties/dom/current-element-node The following code tries to get the current element, but raises an unexpected SAXNotRecognizedException : if (parser != null) { Object o = null; try { o = parser.getProperty("http://apache.org/xml/properties/dom/current- element-node"); } catch (SAXException e) { // error handling } Looking at DOMParser.java, we can see that getProperty(String propertyId) first check is to compare the propertyId string to CURRENT_ELEMENT_NODE : if (propertyId.equals(CURRENT_ELEMENT_NODE)) { ... } but CURRENT_ELEMENT_NODE is sadly initialized to an incorrect value in AbstractDOMParser.java : protected static final String CURRENT_ELEMENT_NODE= Constants.XERCES_FEATURE_PREFIX + Constants.CURRENT_ELEMENT_NODE_PROPERTY; (where XERCES_FEATURE_PREFIX should be corrected to XERCES_PROPERTY_PREFIX). Thus, a basic workaround to get a correct behaviour is, in my application, to query : o = parser.getProperty(Constants.XERCES_FEATURE_PREFIX + Constants.CURRENT_ELEMENT_NODE_PROPERTY); By the way, why wouldn't you give a public access to the handy constant AbstractDOMParser.CURRENT_ELEMENT_NODE (and to its similar brothers) ? Regards. Patrick --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
