【发布时间】:2014-05-09 20:06:24
【问题描述】:
我正在编写一个仪表板设计器,它将基于 xml 值创建小部件。
喜欢
<dashboard>
<widget type="chart">
</widget>
</dashboard>
我想根据 @type 的值更改
<dashboard>
<widget type="chart">
<title text="Chart Title"></title>
<plotOptions>
<plotOptions>
<pie showInLegend="true" shadow="false" innerSize="50%">
<dataLabels color="#fff" distance="-20" format="{point.percentage:.0f} %" overflow="false"></dataLabels>
</pie>
</plotOptions>
<legend width="150" align="right" x="10" layout="vertical">
<navigation></navigation>
</legend>
<tooltip enabled="false"></tooltip>
<exporting enabled="true"></exporting>
</plotOptions>
</widget>
</dashboard>
如果我们有 type="table" 它应该允许不同的标签
<dashboard>
<widget type="table">
<title text="Table Title"></title>
<thead>
<tr>
<th>One</th>
<th>Two</th>
<th>Three</th>
</tr>
</thead>
<tbody>
<tr>
<td>DS.One</td>
<td>DS.Two</td>
<td>DS.Three</td>
</tr>
</tbody>
</widget>
</dashboard>
它还应该在 XML 编辑器中给出自动建议,例如 "ECLIPSE"
【问题讨论】:
标签: xml xml-parsing xsd xsd-validation xsd-1.1