jkesselm 01/11/26 10:51:49
Modified: java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java
Log:
Sigh. The XML Namespaces spec it itself imperfectly
namespace-aware. While there's a plan to fix that, it's
safer for now if we test the QName when looking for
explicit instances of xmlns:xml in the source document.
Revision Changes Path
1.22 +9 -3
xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
Index: DOM2DTM.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- DOM2DTM.java 2001/11/20 13:46:51 1.21
+++ DOM2DTM.java 2001/11/26 18:51:48 1.22
@@ -560,9 +560,15 @@
// If the xml: prefix is explicitly declared
// we don't need to synthesize one.
+ //
+ // NOTE that XML Namespaces were not originally
+ // defined as being namespace-aware (grrr), and
+ // while the W3C is planning to fix this it's
+ // safer for now to test the QName and trust the
+ // parsers to prevent anyone from redefining the
+ // reserved xmlns: prefix
if(!m_processedFirstElement
- &&
NAMESPACE_DECL_NS.equals(attrs.item(i).getNamespaceURI())
- && "xml".equals(attrs.item(i).getLocalName()))
+ && "xmlns:xml".equals(attrs.item(i).getNodeName()))
m_processedFirstElement=true;
}
// Terminate list of attrs, and make sure they aren't
@@ -570,7 +576,7 @@
} // if attrs exist
if(!m_processedFirstElement)
{
- // The DOM may not have an explicit declartion for the
+ // The DOM might not have an explicit declaration for the
// implicit "xml:" prefix, but the XPath data model
// requires that this appear as a Namespace Node so we
// have to synthesize one. You can think of this as
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]