@Override public String convert(Document original) { return original.toXML(); } }
@Override public String convert(Document original) { return original.toXML(); } }
@Override public String convert(Document original) { return original.toXML(); } }
@Override public String toString() { return doc.toXML(); } }
public String asXmlString(){ return this.broadcastMessageDocument.toXML(); }
@Override public int hashCode() { int result = broadcastMessageDocument != null ? broadcastMessageDocument.toXML().hashCode() : 0; result = 31 * result + (int) (timeCreated ^ (timeCreated >>> 32)); return result; }
@Override protected void serialize(Type type, Object object, DataOutputStream dos) throws TrSerializableException, IOException { final Document doc = (Document) object; String docInXml = doc.toXML(); dos.writeUTF(docInXml); } }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ParsedBroadcastMessage that = (ParsedBroadcastMessage) o; if (timeCreated != that.timeCreated) return false; if (broadcastMessageDocument != null ? !broadcastMessageDocument.toXML().equals(that.broadcastMessageDocument.toXML()) : that.broadcastMessageDocument != null) return false; return true; }
public static HttpEntity createEntity(Document doc) { try { return new StringEntity(doc.toXML(), "UTF-8"); } catch (UnsupportedEncodingException shouldNeverHappen) { throw new RuntimeException(shouldNeverHappen); } }
public static HttpEntity createEntity(Document doc) { try { return new StringEntity(doc.toXML(), "UTF-8"); } catch (UnsupportedEncodingException shouldNeverHappen) { throw new RuntimeException(shouldNeverHappen); } }
public static HttpEntity createEntity(Document doc) { try { return new StringEntity(doc.toXML(), "UTF-8"); } catch (UnsupportedEncodingException shouldNeverHappen) { throw new RuntimeException(shouldNeverHappen); } }
public static String readXmlAsStringFromFile(String xmlFilePath){ Document doc = null; doc = createDocumentFromFile(xmlFilePath); if (doc != null) { return doc.toXML(); } return null; }
public static String xmlToString(Element elm) { // TODO ugly hack to retain namespaces return new Document((Element) elm.copy()).toXML().replaceFirst("<.+>", ""); }
new UpdatedSinceEntryFilter(getLastUpdated())); String xml = doc.toXML();
public void shouldConvertToXml() { JsonObject object = sampleJson(); Element element = JsonXmlConverter.getElement(object, "r"); Document document = new Document(element); String xml = document.toXML(); Assert.assertTrue(xml.contains("<r>"), "should contain the opening tag <r>"); }
/** * Utility method that allows for convenient conversion of * <a href="http://www.cafeconleche.org/XOM/apidocs/index.html">XOM</a> elements to * CML elements if necessary. * always makes a copy * * @param xml a valid CMLElement * @return the {@link CMLElement} */ public static CMLElement ensureCML(Element xml) { if (xml == null) { throw new RuntimeException("null cml"); } if (xml instanceof CMLElement) { return (CMLElement) xml.copy(); } else { Document doc = new Document((Element) xml.copy()); try { Document doc2 = new CMLBuilder().build(doc.toXML(), doc.getBaseURI()); CMLElement cmlElement = (CMLElement) doc2.getRootElement(); return cmlElement; } catch (Exception e) { CMLUtil.debug(xml, "ensureCMLProblem "+e); throw new RuntimeException("ensureCMLProblem", e); } } }
seqElement.appendChild(imageElement2); writer.write(doc.toXML()); writer.flush(); } catch (IOException ex) {
seqElement.appendChild(imageElement2); writer.write(doc.toXML()); writer.flush(); } catch (IOException ex) {