可以在cfscript中创建<cfxml>吗?

时间:2019-10-21 16:03:18

标签: coldfusion xml-parsing cfml

是否可以在cfscript中使用?我在网上找不到一个简单的例子。我有一个使用cfscript构建的.cfc文件,并且正在尝试使用cfxml。

我有一个XMLContent变量,并且尝试了下面的代码。

cfxml variable="myXML" {
    WriteOutPut(#XMLContent#);
}

它在我的cfxml声明中返回:function keyword is missing in FUNCTION declaration.

1 个答案:

答案 0 :(得分:5)

您可以这样做。

cfxml (variable="myXML") {
    WriteOutPut(XMLContent);
}

但是我怀疑您正在尝试

  <cfscript>
  myXML = XMLParse(XMLContent);
  </cfscript>