public void SetPrefixesFromReader(GXXMLReader rdr) { for (int i = 1; i <= rdr.AttributeCount; i++) { string attName = rdr.GetAttributeName(i); if (attName.ToLower().StartsWith("xmlns:")) { AddNamespacePrefix(attName.Substring(6), rdr.GetAttributeByIndex(i)); } else if (attName.ToLower() == "xmlns") { AddNamespacePrefix("", rdr.GetAttributeByIndex(i)); } } }
void setNamespaceContext(GXXMLReader rdr, bool setLocalNamespace) { for (int i = 1; i <= rdr.AttributeCount; i++) { string attName = rdr.GetAttributeName(i); if (attName.ToLower().StartsWith("xmlns:")) { AddNamespacePrefix(attName.Substring(6), rdr.GetAttributeByIndex(i)); } else if (attName.ToLower() == "xmlns" && setLocalNamespace) { AddNamespacePrefix("", rdr.GetAttributeByIndex(i)); } } }