Appearance
ToXML
将实体变量序列化为XML字符串。
业务属性
| 属性 | 含义 | 说明 | 输入限定 | 示例值 |
|---|---|---|---|---|
| enable | 是否启用该控件,未启用时不编译 | 是否编译 | 选择值 | 启用 |
| name | 控件返回值命名 | 控件输出值变量名 | 常量 | xml |
| text | 与控件关联的文本 | 设计页控件显示 | 常量 | toXml |
| param | 实体变量 | 流程变量 | #{object} | |
| rootName | 根节点 | 常量 | root |
使用示例
使用LuaScript控件定义一个实体:
lua
local object = { text = "this is a text" }local object = { text = "this is a text" }
ToXML控件返回值命名为xml,参数输入#{object},根节点输入root

添加输出控件输出返回值xml

使用curl请求接口:
$ curl http://localhost:6636/api/toXML$ curl http://localhost:6636/api/toXML接口返回:
json
{
"xml": "<root>\n <text>this is a text</text>\n</root>"
}{
"xml": "<root>\n <text>this is a text</text>\n</root>"
}