我正在转换xml以通过xslt位解析它来生成新的xml,同时通过xalan api进行转换。现在我正在进行转换
String mess = "C:\\wer\\erty.xml";
mess = mess.trim().replaceFirst("^([\\W]+)<","<");
// perform XSL transformation
xsltTransformer.transform(msgStreamSource, xmlOutput);
我收到以下错误..
ERROR: 'Content is not allowed in prolog.'
ERROR: 'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Content is not allowed in prolog.'
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Content is not allowed in prolog.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)