![]() |

当然,你不能粗犷得太离谱.
<?xml version="1.0" encoding="utf-8"?> <DataRoot> <Record> <OrderID>10248</OrderID> <CustomerID>VINET</CustomerID> <Freight>1,232.38</Freight> </Record> <Record> <OrderID>10249</OrderID> <CustomerID>TOMSP</CustomerID> <Freight>11.60</Freight> </Record> ...(略) </DataRoot>

元素 <DataRoot>、<Record> 的命名是任意的,不一定要写成 DataRoot、Record
<?xml version="1.0" encoding="utf-8"?> <TreeList> <Properties Title="订单明细表"></Properties> <Cols> <Col name="OrderID" width="70" align="center">订单号|Order ID</Col> <Col name="CustomerID" width="70">客户号|CustomerID</Col> <Col name="Freight" width="100" datatype="double">货重|Freight</Col> </Cols> </TreeList>规范中的大部分属性都不需要书写,因为不写就是自动采用默认。在演示包的Treelist子目录下有大量的模板文件,请自行参考。
| 片段 | 标准解析器 | Supcan解析器 |
|---|---|---|
| <CustomerID>abcde</customerid> | ![]() | ![]() |
| 片段 | 标准解析器 | Supcan解析器 |
|---|---|---|
| <Properties title="物资清单"></Properties> | ![]() | ![]() |
| <Properties title=物资清单></Properties> | ![]() | ![]() |
| 片段 | 标准解析器 | Supcan解析器 |
|---|---|---|
| <Properties title="John&Sam"></Properties> | ![]() | ![]() |
| <Properties title="John&Sam"></Properties> | ![]() | ![]() |
{"Record": [
{"Country":"Austria","OrderID":"10258","CustomerID":"ERNSH","OrderDate":"2006.07.17"},
{"Country":"Austria","OrderID":"10263","CustomerID":"ERNSH","OrderDate":null},
{"Country":"Austria","OrderID":"10747","CustomerID":"PICCO","OrderDate":"2007.11.19"},
...(略)
]}

对象名不一定要写成 "Record",你可以任意命名.

日期支持类似 "\/Date(783643765+0800)\/" 的格式; 中文支持类似 "\u0f88\u44f0" 的格式.

也可以写成这样:
[
{"Country":"Austria","OrderID":"10258","CustomerID":"ERNSH","OrderDate":"2006.07.17"},
{"Country":"Austria","OrderID":"10263","CustomerID":"ERNSH","OrderDate":null},
{"Country":"Austria","OrderID":"10747","CustomerID":"PICCO","OrderDate":"2007.11.19"},
...(略)
]
{
"TreeList": {
"Properties": {"Title":"订单明细表"},
"Cols": [
{"name":"Country", "width":100, "text":"国家|Country"},
{"name":"OrderID", "width":70, "align":"center", "text":"订单号|OrderID"},
{"name":"CustomerID", "width":70, "text":"客户号|CustomerID"},
]
}
}
XML中的 <Col>国家</Col> 中的"国家"是用 { "text":"国家" } 来代替的。| 片段 | 标准解析器 | Supcan解析器 |
|---|---|---|
| { "align": "left" } | ![]() | ![]() |
| { align: "left" } | ![]() | ![]() |
| { "align": left } | ![]() | ![]() |
| { align: left } | ![]() | ![]() |
| { 'align': 'left' } | 不一定 | ![]() |
| 片段 | 标准解析器 | Supcan解析器 |
|---|---|---|
| { "align": "left' } | ![]() | ![]() |
| 片段 | 标准解析器 | Supcan解析器 |
|---|---|---|
| { "dataURL": "http:\/\/localhost\/index.aspx" } | ![]() | ![]() |
| { "dataURL": "http://localhost/index.aspx" } | 不一定 | ![]() |

标识符 (即 [..] 中的串) 大小写不敏感.

里面回车符不可省略, 包括最后(头部结尾处)的回车符.