新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   >>中国XML论坛<<     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论XSL,XSLT,XSL-FO,CSS等技术
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 XSL/XSLT/XSL-FO/CSS 』 → 紧急救助xslt和xpath处理两个xml文档的问题,救命啊 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 15679 个阅读者浏览上一篇主题  刷新本主题   平板显示贴子 浏览下一篇主题
     * 贴子主题: 紧急救助xslt和xpath处理两个xml文档的问题,救命啊 举报  打印  推荐  IE收藏夹 
       本主题类别: 样式表技术(XSL, XSLT, XSL-FO, CSS) | XML文档存取技术(DOM, SAX)    
     abc911 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:2
      积分:57
      门派:XML.ORG.CN
      注册:2010/5/27

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给abc911发送一个短消息 把abc911加入好友 查看abc911的个人资料 搜索abc911在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看abc911的博客楼主
    发贴心情 紧急救助xslt和xpath处理两个xml文档的问题,救命啊

    用xslt和xpath处理fc.xml和footyresult.xml, 要求:
    在fc.xml里面找出各个<team>里面的<name>和<headCoach>然后在footyresult.xml里面的/season/round路径下找出 math里面的team的name对应fc.xml里面的team name. 输出:team的分数score里的<goal>和<behind>

    文件如下:
    [color=#FF0000]fc.xml:[/color]

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="q4b.xsl"?>
    <footballClub xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FC.xsd">
     <team>
      <name>Brisbane Lions</name>
      <address>Brisbane</address>
      <captain>S.Black</captain>
      <headCoach>L.Matthews</headCoach>
     </team>
     <team>
      <name>Carlton Blues</name>
      <address>Carlton</address>
      <captain>N.Stevens</captain>
      <headCoach>D.Pagan</headCoach>
     </team>
     <team>
      <name>Collingwood Magpies</name>
      <address>Collingwood</address>
      <captain>N.Buckley</captain>
      <headCoach>M.Malthouse</headCoach>
     </team>
     <team>
      <name>Essendon Bombers</name>
      <address>Essendon</address>
      <captain>M.Loyd</captain>
      <headCoach>K.Sheedy</headCoach>
     </team>
     <team>
      <name>Fremantle Dockers</name>
      <address>Fremantle</address>
      <captain>M.Pavlich</captain>
      <headCoach>C.Connolly</headCoach>
     </team>
     <team>
      <name>Geelong Cats</name>
      <address>Geelong</address>
      <captain>T.Harley</captain>
      <headCoach>M.Thompson</headCoach>
     </team>
     <team>
      <name>Hawthorn Hawks</name>
      <address>Hawthorn</address>
      <captain>S.Mitchell</captain>
      <headCoach>A.Clarkson</headCoach>
     </team>
     <team>
      <name>Melbourne Demons</name>
      <address>Melbourne</address>
      <captain>D.Neitz</captain>
      <headCoach>N.Danniher</headCoach>
     </team>
     <team>
      <name>North Melbourne Kangaroos</name>
      <address>North Melbourne</address>
      <captain>A.Simpson</captain>
      <headCoach>D.Laidley</headCoach>
     </team>
     <team>
      <name>Port Adelaide Powers</name>
      <address>Port Adelaide</address>
      <captain>W.Treadrea</captain>
      <headCoach>M.Williams</headCoach>
     </team>
     <team>
      <name>Richmond Tigers</name>
      <address>Richmond</address>
      <captain>K.Jonhson</captain>
      <headCoach>T.Wallace</headCoach>
     </team>
     <team>
      <name>Saint Kilda Saints</name>
      <address>Saint Kilda</address>
      <captain>N.Riewoldt</captain>
      <captain>L.Ball</captain>
      <headCoach>G.Thomas</headCoach>
     </team>
     <team>
      <name>Sydney Swans</name>
      <address>Sydney</address>
      <captain>B.Kirk</captain>
      <captain>L.Barry</captain>
      <captain>B.Hall</captain>
      <headCoach>P.Roos</headCoach>
     </team>
     <team>
      <name>West Coast Eagles</name>
      <address>Perth</address>
      <captain>C.Judd</captain>
      <headCoach>J.Worsfold</headCoach>
     </team>
     <team>
      <name>Western Bulldogs</name>
      <address>Footscray</address>
      <captain>B.Johnson</captain>
      <headCoach>R.Eade</headCoach>
     </team>
     <team>
      <name>Adelaide Crows</name>
      <address>Adelaide</address>
      <captain>S.Goodwin</captain>
      <headCoach>N.Craig</headCoach>
     </team>
    </footballClub>

    [/QUOTE]

    [color=#FF0000]footyresult.xml:[/color]
    [QUOTE]
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="q2a.xsl"?>
    <season year="2007" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="footyResults.xsd">
     <round no="1">
      <match gameNo="1">
       <team home="yes">
        <name>Melbourne Demons</name>
        <score>
         <goal>9</goal>
         <behind>8</behind>
        </score>
        <highestGoalKicker>
         <name>D.Neitz</name>
         <goal>3</goal>
        </highestGoalKicker>
        <highestGoalKicker>
         <name>R.Robertson</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
       <team home="no">
        <name>Saint Kilda Saints</name>
        <score>
         <goal>13</goal>
         <behind>15</behind>
        </score>
        <highestGoalKicker>
         <name>F.?Gehrig</name>
         <goal>4</goal>
        </highestGoalKicker>
       </team>
      </match>
      <match gameNo="2">
       <team home="yes">
        <name>Fremantle Dockers</name>
        <score>
         <goal>16</goal>
         <behind>0</behind>
        </score>
        <highestGoalKicker>
         <name>M.Pavlich</name>
         <goal>5</goal>
        </highestGoalKicker>
       </team>
       <team home="no">
        <name>Port Adelaide Powers</name>
        <score>
         <goal>19</goal>
         <behind>7</behind>
        </score>
        <highestGoalKicker>
         <name>D.White</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
      </match>
      <match gameNo="3">
       <team home="no">
        <name>Collingwood Magpies</name>
        <score>
         <goal>12</goal>
         <behind>10</behind>
        </score>
        <highestGoalKicker>
         <name>P.Medhurst</name>
         <goal>2</goal>
        </highestGoalKicker>
       </team>
       <team home="yes">
        <name>North Melbourne Kangaroos</name>
        <score>
         <goal>10</goal>
         <behind>19</behind>
        </score>
        <highestGoalKicker>
         <name>B.Harvey</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
      </match>
      <match gameNo="4">
       <team home="yes">
        <name>Brisbane Lions</name>
        <score>
         <goal>9</goal>
         <behind>15</behind>
        </score>
        <highestGoalKicker>
         <name>A.McGrath</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
       <team home="no">
        <name>Hawthorn Hawks</name>
        <score>
         <goal>6</goal>
         <behind>8</behind>
        </score>
        <highestGoalKicker>
         <name>L.Franklin</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
      </match>
      <match gameNo="5">
       <team home="yes">
        <name>Sydney Swans</name>
        <score>
         <goal>10</goal>
         <behind>13</behind>
        </score>
        <highestGoalKicker>
         <name>N.Davis</name>
         <goal>2</goal>
        </highestGoalKicker>
       </team>
       <team home="no">
        <name>West Coast Eagles</name>
        <score>
         <goal>11</goal>
         <behind>8</behind>
        </score>
        <highestGoalKicker>
         <name>M.Seaby</name>
         <goal>2</goal>
        </highestGoalKicker>
        <highestGoalKicker>
         <name>C.Judd</name>
         <goal>2</goal>
        </highestGoalKicker>
        <highestGoalKicker>
         <name>A.Hunter</name>
         <goal>2</goal>
        </highestGoalKicker>
       </team>
      </match>
      <match gameNo="6">
       <team home="yes">
        <name>Adelaide Crows</name>
        <score>
         <goal>10</goal>
         <behind>14</behind>
        </score>
        <highestGoalKicker>
         <name>N.Bock</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
       <team home="no">
        <name>Essendon Bombers</name>
        <score>
         <goal>16</goal>
         <behind>9</behind>
        </score>
        <highestGoalKicker>
         <name>S.Lucas</name>
         <goal>7</goal>
        </highestGoalKicker>
       </team>
      </match>
      <match gameNo="7">
       <team home="yes">
        <name>Western Bulldogs</name>
        <score>
         <goal>17</goal>
         <behind>11</behind>
        </score>
        <highestGoalKicker>
         <name>B.Johnson</name>
         <goal>8</goal>
        </highestGoalKicker>
       </team>
       <team home="no">
        <name>Geelong Cats</name>
        <score>
         <goal>13</goal>
         <behind>15</behind>
        </score>
        <highestGoalKicker>
         <name>C.Mooney</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
      </match>
      <match gameNo="8">
       <team home="yes">
        <name>Carlton Blues</name>
        <score>
         <goal>15</goal>
         <behind>25</behind>
        </score>
        <highestGoalKicker>
         <name>B.Fevola</name>
         <goal>3</goal>
        </highestGoalKicker>
       </team>
       <team home="no">
        <name>Richmond Tigers</name>
        <score>
         <goal>15</goal>
         <behind>8</behind>
        </score>
        <highestGoalKicker>
         <name>K.Pettifer</name>
         <goal>4</goal>
        </highestGoalKicker>
       </team>
      </match>
     </round>
    </season>



       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/5/27 16:20:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/10/31 23:46:37

    本主题贴数3,分页: [1]

     *树形目录 (最近20个回帖) 顶端 
    主题:  紧急救助xslt和xpath处理两个xml文档的问题,救命啊(7822字) - abc911,2010年5月27日
        回复:  看一下能否解决你的问题:XSLT:=============================..(4900字) - jj_long,2010年5月27日
            回复:  非常感谢(8字) - abc911,2010年5月28日

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