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

ParseXML控件返回值命名为object
,参数输入#{xml}

xml
字符串将反序列化为object
实体
添加输出控件输出ParseXML控件的返回值object
输出控件data输入:
json
{
"object": "#{object}"
}
{
"object": "#{object}"
}

使用curl请求接口:
$ curl http://localhost:6636/api/parseXML
$ curl http://localhost:6636/api/parseXML
接口返回:
json
{
"object": {
"string": "this is a custom xml"
}
}
{
"object": {
"string": "this is a custom xml"
}
}