新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   >>中国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将多个xml合成输出一个xml文件 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 11259 个阅读者浏览上一篇主题  刷新本主题   平板显示贴子 浏览下一篇主题
     * 贴子主题: 如何通过xslt将多个xml合成输出一个xml文件 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     johnsun 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:2
      积分:53
      门派:XML.ORG.CN
      注册:2004/3/31

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给johnsun发送一个短消息 把johnsun加入好友 查看johnsun的个人资料 搜索johnsun在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看johnsun的博客楼主
    发贴心情 

    综合页:
    <?xml version="1.0"?>
    <?xml:stylesheet type="text/xsl" href="merge.xsl"?>
    <ph:index xmlns:ph="http://ananas.org/2003/tips/photo">
       <ph:title>City sights</ph:title>
       <ph:entry>london</ph:entry>
       <ph:entry>geneva</ph:entry>
       <ph:entry>paris</ph:entry>
       <ph:entry>roma</ph:entry>
    </ph:index>

    -----------------------------
    样式:merge.xsl
    -----------------------------
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:ph="http://ananas.org/2003/tips/photo">

    <xsl:output method="html"/>

    <xsl:template match="ph:index">
       <html>
          <head><title><xsl:value-of select="ph:title"/></title></head>
          <xsl:apply-templates/>
       </html>
    </xsl:template>

    <xsl:template match="ph:index/ph:title">
       <h1><xsl:apply-templates/></h1>
    </xsl:template>

    <xsl:template match="ph:entry">
       <img src="{concat(.,'.jpg')}" align="right"/>
       <xsl:apply-templates select="document(concat(.,'.xml'))"/>
       <br clear="right"/>
       <br clear="left"/>
    </xsl:template>

    <xsl:template match="ph:photo/ph:title">
       <h2><xsl:apply-templates/></h2>
    </xsl:template>

    <xsl:template match="ph:location">
       <h3>in <xsl:apply-templates/></h3>
    </xsl:template>

    <xsl:template match="ph:date">
       <p>Date: <xsl:apply-templates/></p>
    </xsl:template>

    <xsl:template match="ph:description">
       <p><xsl:apply-templates/></p>
    </xsl:template>

    </xsl:stylesheet>

    -----------------------------
    各分页:london.xml
    -----------------------------
    <?xml version="1.0"?>
    <ph:photo xmlns:ph="http://ananas.org/2003/tips/photo">
       <ph:title>Double-decker bus</ph:title>
       <ph:location>London</ph:location>
       <ph:date>October 2002</ph:date>
       <ph:description>
          The unescapable symbol of London, the double-decker bus is much taller
          than typical buses to carry many passagers through London overcrowded
          streets.
       </ph:description>
    </ph:photo>
    -----------------------------
    分页:geneva.xml(其他从略)
    -----------------------------
    <?xml version="1.0"?>
    <ph:photo xmlns:ph="http://ananas.org/2003/tips/photo">
       <ph:title>The Jet d'Eau fountain</ph:title>
       <ph:location>Geneva</ph:location>
       <ph:date>April 2003</ph:date>
       <ph:description>
          The Jet d'Eau fountain is the most recognizeable symbol of Geneva.
          The fountain reaches 140 meters (460 feet) high, roughly the same height
          as the Embassy Suites hotel in Times Square.
       </ph:description>
    </ph:photo>

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2004/3/31 10:29: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/5/13 10:01:01

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

     *树形目录 (最近20个回帖) 顶端 
    主题:  如何通过xslt将多个xml合成输出一个xml文件(156字) - zzysh,2004年2月1日
        回复:  学习……(8字) - faly,2004年4月6日
        回复:  综合页:<?xml version="1.0"?><?xml:stylesheet type=..(2555字) - johnsun,2004年3月31日
        回复:  可以先把两个XML合并到一块吧,然后整体输出不知道是不是这个意思..(65字) - diegor,2004年3月11日
        回复:  用<xsl:variable>和<xsl:copy-of>如何?C.xsl文件:<?xml..(520字) - teiki,2004年2月19日
        回复:  你可以用组试试!!!(20字) - PURSUE,2004年2月19日
        回复:  <xsl:for-each select="document('data1.xml')/节点">..(340字) - faly,2004年2月11日
        回复:  直接加我QQ:290207741(21字) - stonerain,2004年2月9日
        回复:  我的做法是,先用JAVASCRIPT+XMLDOM把多个xml文件合成一个,然后再用XSL把xml..(87字) - stonerain,2004年2月9日
        回复:  没有人知道吗?顶一下(20字) - zzysh,2004年2月1日

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