@Override @SuppressIsSafeHtmlCastCheck public Element createElement(Document doc, String tagName) { if (tagName.contains(":")) { // Special implementation for tag names with namespace-prefixes. The only // way to get IE to reliably create namespace-prefixed elements is // through innerHTML. Element container = ensureContainer(doc); container.setInnerHTML("<" + tagName + "/>"); // Remove the element before returning it, so that there's no chance of // it getting clobbered later. Element elem = container.getFirstChildElement(); container.removeChild(elem); return elem; } // No prefix. Just use the default implementation (don't use super impl // here in case it changes at some point in the future). return createElementInternal(doc, tagName); }
@Override public Element createElement(Document doc, String tagName) { if (tagName.contains(":")) { // Special implementation for tag names with namespace-prefixes. The only // way to get IE to reliably create namespace-prefixed elements is // through innerHTML. Element container = ensureContainer(doc); container.setInnerHTML("<" + tagName + "/>"); // Remove the element before returning it, so that there's no chance of // it getting clobbered later. Element elem = container.getFirstChildElement(); container.removeChild(elem); return elem; } // No prefix. Just use the default implementation (don't use super impl // here in case it changes at some point in the future). return createElementInternal(doc, tagName); }
@Override public Element createElement(Document doc, String tagName) { if (tagName.contains(":")) { // Special implementation for tag names with namespace-prefixes. The only // way to get IE to reliably create namespace-prefixed elements is // through innerHTML. Element container = ensureContainer(doc); container.setInnerHTML("<" + tagName + "/>"); // Remove the element before returning it, so that there's no chance of // it getting clobbered later. Element elem = container.getFirstChildElement(); container.removeChild(elem); return elem; } // No prefix. Just use the default implementation (don't use super impl // here in case it changes at some point in the future). return createElementInternal(doc, tagName); }