< prev index next >
src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java
Print this page
@@ -25,11 +25,10 @@
package com.sun.xml.internal.bind.v2.runtime;
import com.sun.istack.internal.FinalArrayList;
import com.sun.istack.internal.SAXException2;
-
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.stream.XMLStreamException;
@@ -97,10 +96,11 @@
// as-is in the marshalled output (instead of reassigned to something else,
// which may happen if you'd use declareNsUri.)
serializer.getNamespaceContext().force(
prefixMap.get(i + 1), prefixMap.get(i));
}
+
// make sure namespaces needed by attributes are bound
for( int i=0; i<len; i++ ) {
String qname = atts.getQName(i);
if(qname.startsWith("xmlns") || atts.getURI(i).length() == 0)
continue;
@@ -125,11 +125,10 @@
} catch (XMLStreamException e) {
throw new SAXException2(e);
}
}
- // make sure namespaces needed by attributes are bound
private String getPrefix(String qname) {
int idx = qname.indexOf(':');
String prefix = (idx == -1) ? "" : qname.substring(0, idx);
return prefix;
}
< prev index next >