在java中通过xalan进行xslt转换时出现异常错误

时间:2015-03-31 04:53:43

标签: java xslt xalan

我正在转换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)

0 个答案:

没有答案