/** * <p> * This removes the attribute with the given name and within no * namespace. If no such attribute exists, this method does nothing. * </p> * * @param name name of attribute to remove * @return whether the attribute was removed */ public boolean removeAttribute(final String name) { return removeAttribute(name, Namespace.NO_NAMESPACE); }
public boolean removeAttribute(String name) { return element.removeAttribute(name); }
public boolean removeAttribute(String name, Namespace ns) { return element.removeAttribute(name, ns); }
public boolean removeAttribute(Attribute attribute) { return element.removeAttribute(attribute); }
private void removeProcessingAttributes(Element elem) { elem.removeAttribute(TEXT_SIZE); elem.removeAttribute(TOTAL_TEXT_SIZE); elem.removeAttribute(TOTAL_TEXT_IN_LINKS); elem.removeAttribute(TEXT_SIZE_SCORE); elem.removeAttribute(TOTAL_NODES); elem.removeAttribute(TOTAL_ELEMENT_NODES); elem.removeAttribute(TOTAL_TEXT_NODES); elem.removeAttribute(TOTAL_LINKS); elem.removeAttribute(TOTAL_PTAGS); elem.removeAttribute(TOTAL_H1TAGS); elem.removeAttribute(TOTAL_IMAGES); elem.removeAttribute(HAS_DIRECT_TEXT); elem.removeAttribute(TEXT_NODE_SCORE); elem.removeAttribute(LINK_SCORE); elem.removeAttribute(LEVEL); elem.removeAttribute(TOTAL_LEVELS); elem.removeAttribute(POSITION); }
public void remove() { attr.getParent().removeAttribute(attr); }
/** * Sets the @isSynthetic flag of the method. */ public void setSynthetic(boolean flag) { if (flag) { methodElement.setAttribute("isSynthetic", "true"); } else { methodElement.removeAttribute("isSynthetic"); } }
/** * * @param newName * the new name for this fully wrapped BioMOBY collection * @param element * the fully wrapped BioMOBY collection * @return @return an element 'Collection' representing the renamed collection * @throws MobyException * if the message is invalid */ public static Element renameCollection(String newName, Element element) throws MobyException { Element e = (Element) element.clone(); Element mobyData = extractMobyData(e); Element coll = mobyData.getChild("Collection"); if (coll == null) coll = mobyData.getChild("Collection", MOBY_NS); if (coll == null) return e; coll.removeAttribute("articleName"); coll.removeAttribute("articleName", MOBY_NS); coll.setAttribute("articleName", newName, MOBY_NS); return coll; }
temp.removeAttribute("queryID"); temp.removeAttribute("queryID", MOBY_NS); temp.setAttribute("queryID", (id == null || id == "" ? "a" + queryCount++ : id), MOBY_NS);
/** * This detaches the <code>Attribute</code> from its parent, or does * nothing if the <code>Attribute</code> has no parent. * * @return <code>Attribute</code> - this <code>Attribute</code> modified. */ public Attribute detach() { final Element parentElement = getParent(); if (parentElement != null) { parentElement.removeAttribute(getName(),getNamespace()); } return this; }
/** * * @param oldName * @param newName * @param type * @param element * @return * @throws MobyException */ public static Element renameSimple(String newName, String type, Element element) throws MobyException { Element e = (Element) element.clone(); Element mobyData = extractMobyData(e); String queryID = getQueryID(e); Element serviceNotes = getServiceNotes(e); Element simple = mobyData.getChild("Simple"); if (simple == null) simple = mobyData.getChild("Simple", MOBY_NS); if (simple == null) { return e; } simple.removeAttribute("articleName"); simple.removeAttribute("articleName", MOBY_NS); simple.setAttribute("articleName", newName, MOBY_NS); return createMobyDataElementWrapper(simple, queryID, serviceNotes); }
private static Element constructElementForComplexType( ComplexTypeDescriptor descriptor, List<String> existingsTypes) { Element result = new Element("complextype", XScuflNS); if (existingsTypes.contains(descriptor.getQname().toString())) { result.setAttribute("id", descriptor.getQname().toString()); populateElement(result, descriptor); result.removeAttribute("qname"); } else { existingsTypes.add(descriptor.getQname().toString()); populateElement(result, descriptor); Element elements = new Element("elements", XScuflNS); for (TypeDescriptor desc : descriptor.getElements()) { Element element = null; if (desc instanceof ComplexTypeDescriptor) { element = constructElementForComplexType( (ComplexTypeDescriptor) desc, existingsTypes); } else if (desc instanceof ArrayTypeDescriptor) { element = constructElementForArrayType( (ArrayTypeDescriptor) desc, existingsTypes); } else if (desc instanceof BaseTypeDescriptor) { element = new Element("basetype", XScuflNS); populateElement(element, desc); } if (element != null) elements.addContent(element); } result.addContent(elements); } return result; }
private static Element constructElementForArrayType( ArrayTypeDescriptor descriptor, List<String> existingsTypes) { Element result = new Element("arraytype", XScuflNS); if (existingsTypes.contains(descriptor.getQname().toString())) { result.setAttribute("id", descriptor.getQname().toString()); populateElement(result, descriptor); result.removeAttribute("qname"); } else { existingsTypes.add(descriptor.getQname().toString()); populateElement(result, descriptor); Element elementType = new Element("elementtype", XScuflNS); if (descriptor.getElementType() instanceof ComplexTypeDescriptor) { elementType.addContent(constructElementForComplexType( (ComplexTypeDescriptor) descriptor.getElementType(), existingsTypes)); } else if (descriptor.getElementType() instanceof ArrayTypeDescriptor) { elementType.addContent(constructElementForArrayType( (ArrayTypeDescriptor) descriptor.getElementType(), existingsTypes)); } else if (descriptor.getElementType() instanceof BaseTypeDescriptor) { Element element = new Element("basetype", XScuflNS); populateElement(element, descriptor.getElementType()); elementType.addContent(element); } result.addContent(elementType); } return result; }
for (Iterator i = attributes.iterator(); i.hasNext();) { Attribute att = (Attribute) i.next(); processorElement.removeAttribute(att);
public void populateItem(Item item, Element eItem, int index) { super.populateItem(item,eItem, index); Element eDescription = eItem.getChild("description",getFeedNamespace()); if (eDescription != null) eDescription.removeAttribute("type"); String author = item.getAuthor(); if (author != null) { eItem.addContent(generateSimpleElement("author", author)); } String comments = item.getComments(); if (comments != null) { eItem.addContent(generateSimpleElement("comments", comments)); } Guid guid = item.getGuid(); if (guid != null) { Element eGuid = generateSimpleElement("guid",guid.getValue()); if (!guid.isPermaLink()) { eGuid.setAttribute("isPermaLink", "false"); } eItem.addContent(eGuid); } }
public void populateItem(Item item, Element eItem, int index) { super.populateItem(item,eItem, index); Element eDescription = eItem.getChild("description",getFeedNamespace()); if (eDescription != null) eDescription.removeAttribute("type"); String author = item.getAuthor(); if (author != null) { eItem.addContent(generateSimpleElement("author", author)); } String comments = item.getComments(); if (comments != null) { eItem.addContent(generateSimpleElement("comments", comments)); } Guid guid = item.getGuid(); if (guid != null) { Element eGuid = generateSimpleElement("guid",guid.getValue()); if (!guid.isPermaLink()) { eGuid.setAttribute("isPermaLink", "false"); } eItem.addContent(eGuid); } }
private Element createActionElement(String actionXml) throws JDOMException, ParseException { Element eAction = XmlUtils.parseXml(actionXml); eAction.removeAttribute("start"); eAction.removeAttribute("end"); eAction.setAttribute("instance-number", Integer.toString(1)); eAction.setAttribute("action-nominal-time", DateUtils.formatDateOozieTZ(DateUtils.parseDateOozieTZ("2009-09-08T01:00Z"))); eAction.setAttribute("action-actual-time", DateUtils.formatDateOozieTZ(new Date())); return eAction; }
private String affectTextElementOrAttributeValueInRightSide( final Element rightSide) { String value = ""; final Attribute workOnAttribute = rightSide.getAttribute("workOnAttribute", Namespace.getNamespace("meta_ebm", "http://com.ebmwebsourcing.easybpel/metadata")); if(workOnAttribute != null) { final String attributeName = Util.getLocalPartWithoutPrefix(workOnAttribute.getValue()); final String prefix = Util.getPrefix(workOnAttribute.getValue()); Namespace nsAttr = null; if((prefix != null) && (prefix.trim().length() > 0)) { final String ns = this.bpeldefinition.getNamespaceContext().getNamespaceURI(prefix); nsAttr = Namespace.getNamespace(prefix, ns) ; } Attribute rightAttribute = null; if(nsAttr != null) { rightAttribute = rightSide.getAttribute(attributeName, nsAttr); } else { rightAttribute = rightSide.getAttribute(attributeName); } // remove metadata attribute rightSide.removeAttribute(workOnAttribute); value = rightAttribute.getValue(); } else { value = rightSide.getText(); } return value; }
eAction.removeAttribute("start"); eAction.removeAttribute("end"); eAction.setAttribute("instance-number", Integer.toString(instanceCount)); eAction.setAttribute("action-nominal-time", DateUtils.formatDateOozieTZ(nominalTime));
elmt.removeAttribute(workOnAttribute);