XSLT which output non-xml text in XProc
Posted: Tue Feb 27, 2018 8:11 pm
I have a XSLT to generate code
text.xsl:
And a XProc
test.xpl
When execute test.xpl, the error occured:
Engine name: Calabash XProc
Severity: error
Description: p:xslt returned non-XML result
Start location: 8:46
I read the document in w3c https://www.w3.org/TR/xproc/#c.xslt
It does not say that the output of p:xslt must be xml.
Is there any way to fix this issue ?
Thanks.
text.xsl:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template name="main">
// Code generated xxxxx
// .......
class Test
{
}
</xsl:template>
</xsl:stylesheet>
test.xpl
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
<p:output port="result" primary="false">
<p:pipe port="result" step="test"/>
</p:output>
<p:xslt name="test" template-name="main">
<p:input port="source">
<p:empty/>
</p:input>
<p:input port="stylesheet">
<p:document href="test.xsl"/>
</p:input>
<p:input port="parameters">
<p:empty/>
</p:input>
</p:xslt>
</p:declare-step>
Engine name: Calabash XProc
Severity: error
Description: p:xslt returned non-XML result
Start location: 8:46
I read the document in w3c https://www.w3.org/TR/xproc/#c.xslt
It does not say that the output of p:xslt must be xml.
Is there any way to fix this issue ?
Thanks.