0

i have a XML, where with that XML i mocked up test data by passing it in excel, i stuck up in getting the multiple mocked up string formatted files to send it to queue as a string.

this is my string formatted mocked up file stored in outputXMLString. this is working for single file but when coming to send the multiple mocked up files, it is taking the latest file. String outputXMLString = writer.getBuffer().toString();

        Transformer tf = TransformerFactory.newInstance().newTransformer();
        tf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
        tf.setOutputProperty(OutputKeys.INDENT, "yes");
        tf.setOutputProperty(OutputKeys.METHOD, "xml");
        tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");

        StringWriter writer = new StringWriter();
        tf.transform(new DOMSource(doc), new StreamResult(writer));
        String outputXMLString = writer.getBuffer().toString();
        System.out.println("----- Sendingtext:--- " + "\n" + outputXMLString);
        return outputXMLString;

0 Answers0