use of org.apache.xmlbeans.XmlObject in project hackpad by dropbox.
the class XML method removeToken.
/**
*
* @param curs
*/
protected void removeToken(XmlCursor curs) {
XmlObject xo = XmlObject.Factory.newInstance();
// Don't delete anything move to another document so it gets orphaned nicely.
XmlCursor tmpCurs = xo.newCursor();
tmpCurs.toFirstContentToken();
curs.moveXml(tmpCurs);
tmpCurs.dispose();
}
use of org.apache.xmlbeans.XmlObject in project camel by apache.
the class XmlBeansConverterTest method toXmlObjectFromByteArray.
@Test
public void toXmlObjectFromByteArray() throws Exception {
XmlObject result = XmlBeansConverter.toXmlObject(PAYLOAD.getBytes(), new DefaultExchange(new DefaultCamelContext()));
assertBuyStocks(result);
}
use of org.apache.xmlbeans.XmlObject in project camel by apache.
the class XmlBeansConverterTest method toXmlObjectFromNode.
@Test
public void toXmlObjectFromNode() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setIgnoringComments(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(PAYLOAD)));
XmlObject result = XmlBeansConverter.toXmlObject(document, new DefaultExchange(new DefaultCamelContext()));
assertBuyStocks(result);
}
use of org.apache.xmlbeans.XmlObject in project camel by apache.
the class XmlBeansConverterTest method toXmlObjectFromXMLStreamReader.
@Test
public void toXmlObjectFromXMLStreamReader() throws Exception {
XmlObject result = XmlBeansConverter.toXmlObject(new XMLStreamReader(new ByteArrayInputStream(PAYLOAD.getBytes()), false), new DefaultExchange(new DefaultCamelContext()));
assertBuyStocks(result);
}
use of org.apache.xmlbeans.XmlObject in project camel by apache.
the class XmlBeansConverterTest method toXmlObjectFromString.
@Test
public void toXmlObjectFromString() throws Exception {
XmlObject result = XmlBeansConverter.toXmlObject(PAYLOAD, new DefaultExchange(new DefaultCamelContext()));
assertBuyStocks(result);
}
Aggregations