List of usage examples for org.jdom2 Element removeAttribute
public boolean removeAttribute(final String attname, final Namespace ns)
This removes the attribute with the given name and within the given Namespace.
From source file:jodtemplate.pptx.postprocessor.StylePostprocessor.java
License:Apache License
private Element getArPrElement(final Element ar) { final List<Element> arPrElements = ar.getContent(Filters.element(PPTXDocument.RPR_ELEMENT, getNamespace())); Element arPr = null; if (CollectionUtils.isNotEmpty(arPrElements)) { arPr = arPrElements.get(0).clone(); arPr.removeAttribute("b", getNamespace()); arPr.removeAttribute("i", getNamespace()); arPr.removeAttribute("u", getNamespace()); }// w w w.j a v a 2s.co m return arPr; }
From source file:org.mycore.datamodel.metadata.validator.MCREditorOutValidator.java
License:Open Source License
public static String checkMetaObject(Element datasubtag, Class<? extends MCRMetaInterface> metaClass, boolean keepLang) { if (!keepLang) { datasubtag.removeAttribute("lang", XML_NAMESPACE); }//from ww w. j a v a2 s . com MCRMetaInterface test = null; try { test = metaClass.newInstance(); } catch (Exception e) { throw new MCRException("Could not instantiate " + metaClass.getCanonicalName()); } test.setFromDOM(datasubtag); test.validate(); return null; }