- // We must not clone the processors, because we remove attributes
- Element substituteElement =
- element.cloneElementNodeWithNewName(element, substituteName, false);
- substituteElement.removeAttribute("charset");
- substituteElement.removeAttribute("th:charset");
- substituteElement.removeAttribute("coords");
- substituteElement.removeAttribute("href");
- substituteElement.removeAttribute("th:href");
- substituteElement.removeAttribute("hreflang");
- substituteElement.removeAttribute("th:hreflang");
- substituteElement.removeAttribute("media");
- substituteElement.removeAttribute("th:media");
- substituteElement.removeAttribute("name");
- substituteElement.removeAttribute("th:name");
- substituteElement.removeAttribute("rel");
- substituteElement.removeAttribute("th:rel");
- substituteElement.removeAttribute("ref");
- substituteElement.removeAttribute("th:ref");
- substituteElement.removeAttribute("shape");
- substituteElement.removeAttribute("target");
- substituteElement.removeAttribute("th:target");
- substituteElement.removeAttribute("type");
- substituteElement.removeAttribute("th:type");
- element.clearChildren();
- element.addChild(substituteElement);
- element.getParent().extractChild(element);