当我在 .CFM
中运行以下代码时运行 ColdFusion 2018 的服务器上的文件:
<cfsetting enablecfoutputonly="yes">
<cfxml variable="test">
<test>
<child>test</child>
</test>
</cfxml>
<cfsetting enablecfoutputonly="no">
我收到错误:
An error occurred while Parsing an XML document. Premature end of file.
当我删除<cfsetting>
时标签,它可以正常工作。这是为什么?
最佳答案
您遇到的问题是 xml 内容被视为空白。使用这个。
由于您的 cfsetting 标记为 enablecfoutputonly
,我们可以说 cfxml
标记只有包含在 cfoutput
中时才能看到内容>.
<cfxml variable="test">
<cfoutput>
<test>
<child>test</child>
</test>
</cfoutput>
</cfxml>
关于xml - CFXML - 当enablecfoutputonly为 "Premature end of file"时为 "yes",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62879168/