}
final String ns = source.getNamespaceURI();
String localName = source.getLocalName();
if (HTMLParser.XHTML_NAMESPACE.equals(ns)) {
final IElementFactory factory = HTMLParser.getFactory(localName);
return factory.createElementNS(page, ns, localName, namedNodeMapToSaxAttributes(source.getAttributes()));
}
final Map<String, DomAttr> attributes = new HashMap<String, DomAttr>();
final NamedNodeMap nodeAttributes = source.getAttributes();
for (int i = 0; i < nodeAttributes.getLength(); i++) {
final Attr attribute = (Attr) nodeAttributes.item(i);