使用 Mule 3.2 我正在尝试从我的 mule 流程中构建 XML,但我收到此错误我在网上尝试了一些想法,但我不断收到此消息。
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" doc:name="XSLT">
<mulexml:xslt-text>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="numericId"/>
<xsl:param name="name"/>
<xsl:param name="url"/>
<xsl:template match="*">
<Publisher>
<numericId><xsl:value-of select="$numericId"/></numericId>
<name><xsl:value-of select="$name"/></name>
<url><xsl:value-of select="$url"/></url>
</Publisher>
</xsl:template>
</xsl:stylesheet>
</mulexml:xslt-text>
<mulexml:context-property key="numericId" value="#[header:SESSION:numericId]"/>
<mulexml:context-property key="name" value="#[header:SESSION:name]"/>
<mulexml:context-property key="url" value="#[header:SESSION:url]"/>
</mulexml:xslt-transformer>
错误:
******************************************************************************** Message : org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (net.sf.saxon.trans.DynamicError) Code : MULE_ERROR-64999
-------------------------------------------------------------------------------- Exception stack is:
1. Content is not allowed in prolog. (org.xml.sax.SAXParseException) org.apache.xerces.util.ErrorHandlerWrapper:-1 (null)
2. org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (net.sf.saxon.trans.DynamicError) net.sf.saxon.event.Sender:308 (null)
3. org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (net.sf.saxon.trans.DynamicError) (org.mule.api.transformer.TransformerException) org.mule.module.xml.transformer.XsltTransformer:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
--------------------------------------------------------------------------------
Root Exception stack trace: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1;
Content is not allowed in prolog.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************