DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=32799>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32799 ------- Additional Comments From [EMAIL PROTECTED] 2004-12-22 20:58 ------- Christian, I digged a bit in the code and here is what I found out: First I assume that you use Xerces as XML parser. With Crimson (the JDK's default parser) you cannot read this XML file at all; an exception is thrown stating that the relative URI sub.xml cannot be resolved without a base URI. This is because we pass a Reader to the parser rather than a file name or a URL. Maybe we will have to change this in future (or provide an EntityHandler or something). But back to your problem: It occurs that Xerces returns an additional attribute "xml:base" for each element of the included XML document. The value of this attribute is set to the full URL from which this document was loaded. For the Configuration class it is impossible to distinguish this attribute from any normal attribute. So it is saved as a property in the Configuration. This indeed happens for both HierarchicalXMLConfiguration and XMLConfiguration. These additional attributes are responsible for the "phantom keys" you face. The reason why the keys are returned by HierarchicalXMLConfiguration and not by XMLConfiguration seems to be a bug in the getKeys(String prefix) method of XMLConfiguration: this method returns only keys starting with the passed in prefix plus a dot, thus missing attributes of the selected element. So it boils down to that from a Configuration's point of view your phantom keys are valid properties because they are reported by the XML parser. Because of that they should be returned by the getKeys() methods. My XML knowledge is probably a bit incomplete in this area, does anybody know more about these xml:base attributes created by Xerces? Under which conditions are they created and what more attributes of this type could occur? FYI, I am working on a merge of the two XML configuration classes. Soon there will be only one class XMLConfiguration with all the features of (the old) XMLConfiguration and HierarchicalXMLConfiguration. Oliver -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
