|
查看: 998|回复: 2
|
XML Schema
[复制链接]
|
|
|
我的 XML 要弄 schema
XML 有个complex type element 是phone
它有三个child (home,business,private),这三个有一个 optional attribute, preferable
home 跟 business 用同样的格式(xx) xxxxxxxx
而private 没有指定格式
请问那位大侠知道什么方式可以把 preferable 在home或business或private只出现一次
XML-
- <customer ID=C1>
- <phone>
- <home>(12) 12345678</home>
- <business>(12) 23456789</business>
- <private preferable="true">123456789</private>
- </phone>
- </customer>
- <customer ID=C2>
- <phone>
- <home preferable="true">(03) 23532522</home>
- <business>(12) 12345678</business>
- <private>123456789</mobile>
- </phone>
- </customer>
- <customer ID=C3>
- <phone>
- <home>(03) 23532522</home>
- <business preferable="true">(12) 12345678</business>
- <private>123456789</private>
- </phone>
- </customer>
- <customer ID=C4>
- <phone>
- <home>(03) 23532522</home>
- <business preferable="true">(12) 12345678</business>
- </phone>
- </customer>
- <customer ID=C5>
- <phone>
- <home preferable="true">(03) 23532522</home>
- <business>(12) 12345678</business>
- </phone>
- </customer>
复制代码 |
|
|
|
|
|
|
|
|
|
|
发表于 29-3-2009 09:27 AM
|
显示全部楼层
与其这样 :
<customer ID=C1>
<phone>
<home>(12) 12345678</home>
<business>(12) 23456789</business>
<private preferable="true">123456789</private>
</phone>
</customer>
不如这样?
<customer ID=C1>
<phone>
<home>(12) 12345678</home>
<business>(12) 23456789</business>
<private>123456789</private>
<preferable>private</preferable>
</phone>
</customer> |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 29-3-2009 01:25 PM
|
显示全部楼层
XML 是客户的不可能去更改
如果要求他改 xml ,那其他系统也要改 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|