以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  悉尼科技大学第一堂课关于XSLT的练习题  大一的你做得出来吗?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=125538)


--  作者:kem064
--  发布时间:8/30/2012 10:15:00 PM

--  悉尼科技大学第一堂课关于XSLT的练习题  大一的你做得出来吗?

Consider XML document given below. Implement XSL Transformation that extracts the partial descriptions of all employees and saves the descriptions in another XML document with the following structure

考虑下面给出的XML文档。执行XSL转换,提取具有以下所有员工结构的部分描述,并保存另一个XML文档中。

<suppliers>
       <supplier>
             <supp-name>…</number>
             <address>…</name>
             <phone>…</phone>
             <phone>…</phone>
              … … …
     </supplier>
       …
</employees>

Use XML Editor to transform the document Save XSL Transformation stylesheet in a filetask2.xsl.

使用XML编辑器来转换文档,并将XSLT stylesheet保存在filetask2.xsl 。

<?xml version="1.0"?>
<suppliers>
     <part pnum="p1">
           <name>part1</name>
           <price>23</price>
           <manufacturer>XYZ Ltd.</manufacturer>
           <consists-of>
                <part pnum="p11">
                      <name>part11</name>
                      <price>67</price>
                      <manufacturer>ABC Ltd.</manufacturer>
                </part>
                <part pnum="p12">
                       <name>part12</name>
                       <price>34</price>
                       <manufacturer>ABC Ltd.</manufacturer>
                </part>
           </consists-of>
      </part>
      <part pnum="p2">
           <name>part2</name>
           <price>56</price>
           <manufacturer>XYZ Ltd.</manufacturer>
           <consists-of>
                <part pnum="p21">
                   <name>part2</name>
                   <price>56</price>
                   <manufacturer>XYZ Ltd.</manufacturer>
                </part>
           </consists-of>
      </part>
      <supplier>
          <supp-name>James</supp-name>
          <address>qqasdf45</address>
          <phone>123445656</phone>
          <phone>123445657</phone>
          <supplies>
              <part-ref pref="p1"/>
              <part-ref pref="p11"/>
              <part-ref pref="p12"/>
          </supplies>
      </supplier>
      <supplier>
          <supp-name>Laureen</supp-name>
          <address>YYrtrt66</address>
          <phone>234568</phone>
          <supplies>
              <part-ref pref="p2"/>
              <part-ref pref="p21"/>
          </supplies>
      </supplier>
</suppliers>


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