this is my first time looking for help here and I hope someone can help me out.
I have been given the task to localize our ant build process after to help reduce build time.
The idea goes something like building an ant task that downloads WSDLs associated with a specific service and save them locally. Long story short, this has been done but for some reason when building a service using the local files I get a 'Content is not allowed in prolog' error in the first imported XSD.
I have searched forums and the most common response is hidden characters before the prolog but I have check the hex code and there are no hidden chars.
This is the WSDL prolog
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
This is the first XSD prolog
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Prolog in hex
3C3F786D6C2076657273696F6E3D2231
2E302220656E636F64696E673D227574
662D3822207374616E64616C6F6E653D
226E6F223F3E
Which are the same as the remote versions.
This is how the downloaded XSDs and WSDLs are saved also.
private Document convertToXML(String xmlSource) throws Exception {
DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xmlSource)));
return document;
}
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.STANDALONE, "no");
transformer.setOutputProperty(OutputKeys.ENCODING, "utf-8");
Result output = new StreamResult(new File(filePath));
Let me know if I should be more specific or if I need to add more info.
Thanks.