佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 998|回复: 2

XML Schema

[复制链接]
发表于 28-3-2009 01:55 PM | 显示全部楼层 |阅读模式
我的 XML 要弄 schema

XML 有个complex type element 是phone
它有三个child (home,business,private),这三个有一个 optional attribute, preferable

home 跟 business 用同样的格式(xx) xxxxxxxx
而private 没有指定格式

请问那位大侠知道什么方式可以把 preferable 在home或business或private只出现一次
XML
  1.        
  2. <customer ID=C1>               
  3.        <phone>
  4.                         <home>(12) 12345678</home>
  5.                         <business>(12) 23456789</business>
  6.                         <private preferable="true">123456789</private>
  7.        </phone>
  8. </customer>


  9. <customer ID=C2>
  10.        <phone>
  11.                         <home preferable="true">(03) 23532522</home>
  12.                         <business>(12) 12345678</business>
  13.                         <private>123456789</mobile>
  14.        </phone>
  15. </customer>


  16. <customer ID=C3>
  17.        <phone>
  18.                         <home>(03) 23532522</home>
  19.                         <business preferable="true">(12) 12345678</business>
  20.                         <private>123456789</private>
  21.        </phone>
  22. </customer>


  23. <customer ID=C4>
  24.        <phone>
  25.                         <home>(03) 23532522</home>
  26.                         <business preferable="true">(12) 12345678</business>
  27.        </phone>
  28. </customer>


  29. <customer ID=C5>
  30.        <phone>
  31.                         <home preferable="true">(03) 23532522</home>
  32.                         <business>(12) 12345678</business>
  33.        </phone>
  34. </customer>
复制代码
回复

使用道具 举报


ADVERTISEMENT

发表于 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 ,那其他系统也要改
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 14-12-2025 09:44 PM , Processed in 1.816028 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表