以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  schema中能够定义外部实体引用吗?急盼高手解答  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=27355)


--  作者:cyclone575
--  发布时间:2/17/2006 9:53:00 AM

--  schema中能够定义外部实体引用吗?急盼高手解答
有如下三个XML文档,现在想在season.xml中引用JamesBaldwin.xml和JimAbbott.xml,使得浏览season.xml时直接显示另外两个文档的内容,请问season.xml文档的schema改怎么写?
season.xml
<?xml version="1.0"?>
<SEASON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Z:\429DevelopVob\429DevelopCode\MBC2_IDS\Bin\Debug\xml\players.xsd">
 <YEAR>1998</YEAR>
 <LEAGUE>
  <LEAGUE_NAME>American</LEAGUE_NAME>
  <DIVISION>
   <DIVISION_NAME>Central</DIVISION_NAME>
   <TEAM>
    <TEAM_CITY>Chicago</TEAM_CITY>
    <TEAM_NAME>White Sox</TEAM_NAME>
        &JimAbbott;
         &JamesBaldwin;
           </TEAM>
  </DIVISION>
 </LEAGUE>
</SEASON>

JamesBaldwin.xml
<?xml version="1.0" encoding="UTF-8"?>
<PLAYER>
  <GIVEN_NAME>James</GIVEN_NAME>
  <SURNAME>Baldwin</SURNAME>
  <POSITION>Starting Pitcher</POSITION>
  <GAMES>37</GAMES>
  <GAMES_STARTED>24</GAMES_STARTED>
  <WINS>13</WINS>
  <LOSSES>6</LOSSES>
  <SAVES>0</SAVES>
  <COMPLETE_GAMES>1</COMPLETE_GAMES>
  <SHUT_OUTS>0</SHUT_OUTS>
  <ERA>5.32</ERA>
  <INNINGS>159</INNINGS>
  <HITS_AGAINST>176</HITS_AGAINST>
  <HOME_RUNS_AGAINST>181</HOME_RUNS_AGAINST>
  <RUNS_AGAINST>3</RUNS_AGAINST>
  <EARNED_RUNS>94</EARNED_RUNS>
  <HIT_BATTER>10</HIT_BATTER>
  <WILD_PITCHES>5</WILD_PITCHES>
  <BALK>1</BALK>
  <WALKED_BATTER>60</WALKED_BATTER>
  <STRUCK_OUT_BATTER>108</STRUCK_OUT_BATTER>
</PLAYER>

JimAbbott.xml
<?xml version="1.0" encoding="UTF-8"?>
<PLAYER>
  <GIVEN_NAME>Jim</GIVEN_NAME>
  <SURNAME>Abbott</SURNAME>
  <POSITION>Starting Pitcher</POSITION>
  <GAMES>5</GAMES>
  <GAMES_STARTED>5</GAMES_STARTED>
  <WINS>5</WINS>
  <LOSSES>0</LOSSES>
  <SAVES>0</SAVES>
  <COMPLETE_GAMES>0</COMPLETE_GAMES>
  <SHUT_OUTS>0</SHUT_OUTS>
  <ERA>4.55</ERA>
  <INNINGS>31.2</INNINGS>
  <HITS_AGAINST>35</HITS_AGAINST>
  <HOME_RUNS_AGAINST>2</HOME_RUNS_AGAINST>
  <RUNS_AGAINST>16</RUNS_AGAINST>
  <EARNED_RUNS>16</EARNED_RUNS>
  <HIT_BATTER>1</HIT_BATTER>
  <WILD_PITCHES>0</WILD_PITCHES>
  <BALK>0</BALK>
  <WALKED_BATTER>12</WALKED_BATTER>
  <STRUCK_OUT_BATTER>14</STRUCK_OUT_BATTER>
</PLAYER>



--  作者:SATOKO2006
--  发布时间:2/17/2006 9:57:00 AM

--  
好像用Schema不行吧,用DTD嘛
--  作者:future
--  发布时间:2/22/2006 11:37:00 PM

--  
不行
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms