String name=intToString(elementNameIndex);
String attrname, attrvalue;
// Push a new namespace context
StringToStringTable pushNS=m_emptyNamespace;
// Process any new namespace declarations
if(attrListIndex!=-1)
{
for (int index = xmlAttrList.getFirstAttr(attrListIndex);
index != -1;
index = xmlAttrList.getNextAttr(index))
{
attrname = fStringPool.toString(xmlAttrList.getAttrName(index));
if (attrname.startsWith("xmlns:"))
{
// XML4J very politely offers to stringify this for us
attrvalue = fStringPool.toString(xmlAttrList.getAttValue(index));
String nsprefix = attrname.substring(6);
if(m_emptyNamespace == pushNS)
pushNS = new StringToStringTable();
pushNS.put(nsprefix,attrvalue);
}
else if(attrname.equals("xmlns"))
{
attrvalue = fStringPool.toString(xmlAttrList.getAttValue(index));
if(m_emptyNamespace == pushNS)
pushNS = new StringToStringTable();
pushNS.put(DEFAULT_PREFIX_STR,attrvalue);
}
}
}
namespaceTable.addElement(pushNS);