public Object clone() { return element.clone(); }
public static Element createElementFromText(String xml) { SAXBuilder jdom = new SAXBuilder(); Document doc; try { doc = jdom.build(new StringReader(xml)); } catch (JDOMException | IOException ex) { throw new RuntimeException(ex); } return (Element) doc.getRootElement().clone(); }
public static Element createElementFromText(String xml) { SAXBuilder jdom = new SAXBuilder(); Document doc; try { doc = jdom.build(new StringReader(xml)); } catch (JDOMException | IOException ex) { throw new RuntimeException(ex); } return (Element) doc.getRootElement().clone(); }
public static Element createElementFromText(String xml) { SAXBuilder jdom = new SAXBuilder(); Document doc; try { doc = jdom.build(new StringReader(xml)); } catch (JDOMException | IOException ex) { throw new RuntimeException(ex); } return (Element) doc.getRootElement().clone(); }
/** * Return the full spec element */ public Element getDefinitionSpec() { Element def = (Element)this.definitionElement.clone(); def.detach(); Element spec = new Element("workflow",XScufl.XScuflNS); spec.addContent(def); return spec; }
private void populateBeanElementForElement(Element el, Element bean) { bean.setAttribute(BEAN_ENCODING, JDOMXML_ENCODING); bean.addContent((Element)el.clone()); }
private void populateBeanElementForElement(Element el, Element bean) { bean.setAttribute(BEAN_ENCODING, JDOMXML_ENCODING); bean.addContent((Element)el.clone()); }
public static String writeElementToString(final Element e) { try { final StringWriter sw = new StringWriter(); final Document document = new Document((Element) e.clone()); final XMLOutputter outputter = new XMLOutputter(); outputter.output(document, sw); return sw.getBuffer().toString(); } catch (final IOException ioe) { LOGGER.info("write error", ioe); } return null; }
public static void writeElementToStream(final Element e, final OutputStream os) { try { final BufferedOutputStream bos = new BufferedOutputStream(os); final Document document = new Document((Element) e.clone()); final XMLOutputter outputter = new XMLOutputter(); outputter.output(document, bos); bos.flush(); } catch (final IOException ioe) { LOGGER.info("write error", ioe); } }
public static void writeElementToWriter(final Element e, final Writer writer) { try { final Document document = new Document((Element) e.clone()); final XMLOutputter outputter = new XMLOutputter(); outputter.output(document, writer); } catch (final IOException ioe) { LOGGER.info("write error", ioe); } }
public static void writeElementToStreamPretty(final Element e, final OutputStream os) { try { final BufferedOutputStream bos = new BufferedOutputStream(os); final Document document = new Document((Element) e.clone()); final XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); outputter.output(document, bos); bos.flush(); } catch (final IOException ioe) { LOGGER.info("write error", ioe); } }
/** * * @param element * @return * @throws MobyException */ public static Element createMobyDataElementWrapper(Element element) throws MobyException { Element serviceNotes = getServiceNotes((Element) element.clone()); return createMobyDataElementWrapper(element, "a" + queryCount++, serviceNotes); }
@Override public void noteConfiguration() { configuration = (Element) getQuery().clone(); configurationString = outputter.outputString(configuration); }
public static Element cdr (final Content c) { final Element elt = toElement(c); if (elt.getContent().size() < 1) throw new IllegalArgumentException("cannot cdr an empty element"); Element result = (Element)elt.clone(); //log.debug("cdr() before \n"+XmlUtils.toString(result)); result = removeFirstChild(result); //log.debug("cdr() after \n"+XmlUtils.toString(result)); return result; }
/** * Returns the trimmed text value of an element with MathML descendants removed. * * @param e the element to get the text value from * @return the text value of the element after removal of MathML descendants and whitespace trimming */ private String noMathMLValue(Element e) { return zapNamespace((Element) e.clone(), Namespace.getNamespace("http://www.w3.org/1998/Math/MathML")).getValue().trim(); }
public void pushCurrentElement(ElementBean newBean) { oldParentElement = (Element) rootArtifact.getBaseElement().clone(); setCurrentElement(newBean); elementBeanStack.push(newBean); setCurrentSchemaNode(newBean.getCurrentSchema()); }
/** * The classical clone method. */ public Object clone () { final XmlRawExpression clone = (XmlRawExpression)super.clone(); clone.setXmlBranch((org.jdom.Element)this.getXmlBranch().clone()); return clone; }
/** Creates a new dom document that contains the sorted xml. */ public void sortXml() { newDocument = (Document) originalDocument.clone(); final Element rootElement = (Element) originalDocument.getRootElement().clone(); HierarchyWrapper rootWrapper = factory.createFromRootElement(rootElement); rootWrapper.createWrappedStructure(factory); rootWrapper.detachStructure(); rootWrapper.sortStructureAttributes(); rootWrapper.sortStructureElements(); rootWrapper.connectXmlStructure(); newDocument.setRootElement(rootWrapper.getElementContent().getContent()); }
/** Creates a new dom document that contains the sorted xml. */ public void sortXml() { newDocument = (Document) originalDocument.clone(); final Element rootElement = (Element) originalDocument.getRootElement().clone(); HierarchyRootWrapper rootWrapper = factory.createFromRootElement(rootElement); rootWrapper.createWrappedStructure(factory); rootWrapper.detachStructure(); rootWrapper.sortStructureAttributes(); rootWrapper.sortStructureElements(); rootWrapper.connectXmlStructure(); newDocument.setRootElement(rootWrapper.getElementContent().getContent()); }
protected Element activityToXML(Activity<?> activity) throws JDOMException, IOException { if (activity instanceof DisabledActivity) { ActivityAndBeanWrapper wrapper = ((DisabledActivity) activity).getConfiguration(); return ActivityXMLSerializer.getInstance().activityToXML(wrapper.getActivity(), activity, wrapper.getBean()); } else if (activity instanceof UnrecognizedActivity) { return (Element) ((UnrecognizedActivity) activity).getConfiguration().clone(); } return ActivityXMLSerializer.getInstance().activityToXML(activity); }