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

    >> 本版讨论XSL,XSLT,XSL-FO,CSS等技术
    [返回] 计算机科学论坛XML.ORG.CN讨论区 - XML技术『 XSL/XSLT/XSL-FO/CSS 』 → 如何把XSL转HTML(并且查看结果) 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 5306 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 如何把XSL转HTML(并且查看结果) 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     flyfoxs 帅哥哟,离线,有人找我吗?
      
      
      威望:5
      等级:研一(Artificial Intelligence期期不放过)
      文章:550
      积分:3935
      门派:XML.ORG.CN
      注册:2005/1/8

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

    我在学习XSL,想找一个查看XSL把XML转成html的效果(也就是HTML源码)。


    听说有这样工具,但是我没有找到,到网上下了一个Felix,听说可以,但就是用不起来。


       收藏   分享  
    顶(0)
      




    ----------------------------------------------
    存在即是被搜索!

    BLOG =>  http://www.OpenJ.cn

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/6 12:24:00
     
     kennee 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:4
      积分:68
      门派:XML.ORG.CN
      注册:2005/6/10

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给kennee发送一个短消息 把kennee加入好友 查看kennee的个人资料 搜索kennee在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看kennee的博客2
    发贴心情 
    我也是新手。刚刚发现Word就有此功能,2003版,其他版本不知道有没有。
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/11 0:44:00
     
     flyfoxs 帅哥哟,离线,有人找我吗?
      
      
      威望:5
      等级:研一(Artificial Intelligence期期不放过)
      文章:550
      积分:3935
      门派:XML.ORG.CN
      注册:2005/1/8

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给flyfoxs发送一个短消息 把flyfoxs加入好友 查看flyfoxs的个人资料 搜索flyfoxs在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看flyfoxs的博客3
    发贴心情 
    好知道了,我这就去试试!

    ----------------------------------------------
    存在即是被搜索!

    BLOG =>  http://www.OpenJ.cn

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/11 11:11:00
     
     flyfoxs 帅哥哟,离线,有人找我吗?
      
      
      威望:5
      等级:研一(Artificial Intelligence期期不放过)
      文章:550
      积分:3935
      门派:XML.ORG.CN
      注册:2005/1/8

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给flyfoxs发送一个短消息 把flyfoxs加入好友 查看flyfoxs的个人资料 搜索flyfoxs在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看flyfoxs的博客4
    发贴心情 
    郁闷,我用的2002的,不行啊.

    打开xml.xsl文件,看到的都是代码,不是效果!

    ----------------------------------------------
    存在即是被搜索!

    BLOG =>  http://www.OpenJ.cn

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/11 11:14:00
     
     kennee 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:4
      积分:68
      门派:XML.ORG.CN
      注册:2005/6/10

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给kennee发送一个短消息 把kennee加入好友 查看kennee的个人资料 搜索kennee在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看kennee的博客5
    发贴心情 
    Word2003另存文件,注意“确定”按钮旁的选项。
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/11 13:24:00
     
     孤独 帅哥哟,离线,有人找我吗?
      
      
      威望:7
      等级:大三(面向对象是个好东东!)(版主)
      文章:826
      积分:4220
      门派:XML.ORG.CN
      注册:2004/1/14

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

    ----------------------------------------------
    <?xml version="1.0" encoding="gb2312"?>
    <个人签名>
      <Website>[url=http://www.mahaobo.cn]
    MaHaobo.cn[/url]
    </Website>
    <Email>aloning(at)gmail.com</Email>
      <Qq >32113739</Qq>
    </个人签名>

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/15 8:10:00
     
     jx27 帅哥哟,离线,有人找我吗?
      
      
      等级:大二期末(汇编考了97分!)
      文章:37
      积分:447
      门派:XML.ORG.CN
      注册:2005/6/15

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jx27发送一个短消息 把jx27加入好友 查看jx27的个人资料 搜索jx27在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jx27的博客7
    发贴心情 
    呵呵,这个简单,小弟有CODE,不过做得不好,不要骂我

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright Web Surveys Ltd 2005
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    This xslt is used to generate a xml-instance and output a PRETTY PRINTING page.
    This XSLT provided to 333A coursework as an example for modifications.
    This is the corrected version of the document for exercise 8 of the course
    COMP333 at the University of Waikato produced for Web Surveys Ltd.

    Author Name: Xue Jun (0226318)
    Group Members: Yi Liang, Jia Rong Li
    Contact: jx27@waikato.ac.nz
    Copyright: WSL Survey
    Version:2.0(updated @ 4/06/2005)
    Last Updated: 4 JUN 2005

    Group Decision:
         2 Jun 2005  We decide that next meeting time is 4 Jun 2005
                      Each member will allocated each task.
                      Xue jun: User manual
                      Liang yi: Template Generation
                      Zhang chi: Summary Documentation
                      Li jia rong: Template Generation
                      Huang mu qi: SQL Generation
                      
         4 Jun 2005  We change and update some for-each loops in XSLT.
                      Make it more simple and easy to understand.
                      
    Agreement:
         I have approved the program source document of Mr Liang Yi.
         I was approved by Mr Liang Yi too.

    Previous Version:

    Version 1.0
         Date:  2 Jun 2005
         Change reason: Original
         Author: Xue Jun
    Version 2.0
     -->
    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
    xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
    >
     <xsl:output method="xhtml"
     version="1.1"
     encoding="UTF-8"
     indent="yes"
     doctype-public="-//W3C//DTD XHTML 1.1 Transitional//EN"
     doctype-system="file:/usr/local/share/Exchanger-3.0/types/XHTML/Validation/xhtml1-transitional.dtd"/>
     
    <xsl:template match="/">
        <xsl:processing-instruction name="xml-stylesheet">
          href="color.css" type="text/css"</xsl:processing-instruction>
    <xsl:apply-templates select="*"/>
    </xsl:template>

           <!--
                    The following template is applied to the root element of the
               questionnaire and generates the basic xhtml document structure.
            -->
    <xsl:template match="Qnre" >
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <title>Web Survey Ltd-Questionnaire</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <meta name="author" content="XUE JUN" />
     <style type="text/css">
                body { background-color:#ccff66;   margin-left:3%}
                div    { color:black; margin-left:5%}
                h1   {font-family:arial;   font-size:32;color:blue;   text-align:center}
                h3   {font-family:arial;   font-size:20;   color:red}
                h5 {font-family:arial;  font-size:18;   color:black  ; font-style: italic}
                hr   {color:#000000}
        </style>
    </head>
    <body xml:lang="en">
    <h1><xsl:value-of select="Qtitle"/> ( <xsl:value-of select="@id"/> )</h1>
    <hr/>           <!-- Seperate title and introduction-->
    <xsl:apply-templates select="Qintro"/>
    <xsl:apply-templates select="Qbody"/>
    </body >
    </html>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&    Qintro   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qintro">
    <h3>Questionnaire Introduction:</h3>
    <h5><xsl:value-of select="Qheading"/></h5>
    <hr/>           <!--Seperate introduction and Qbody-->
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&  Qbody  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qbody">
            <!--
                Necessary attributes.
            [Reference]
       Acknowledgement:
         Author: Keith Hopper
         From: COMP333A-05 Developing Web Applications
                              Lecture notes 8C.
                        Url:
    https://flame.cs.waikato.ac.nz/333/Private/Lectures/samples/l8c/skeleton.zip?PHPSESSID=32d055d480a61d728a9c4fdc0c67329a
                        File name: qnre2form.xsl (line 209-230)
             -->

             <!--Create a form element and some attributes.-->
         <xsl:element name="form">
          <xsl:attribute name="method">post</xsl:attribute>
          <xsl:attribute name="action"><xsl:value-of select="@action" /></xsl:attribute>
          <xsl:attribute name="enctype">
            <xsl:choose>
              <!-- uploading file(s) or not -->
              <xsl:when test="@uploads and (@uploads='true')">multipart/form-data</xsl:when>
              <xsl:otherwise>application/x-www-form-urlencoded</xsl:otherwise>
            </xsl:choose>
          </xsl:attribute>

          <xsl:apply-templates select="Qsection"/>
           <table><tr><td><input name="submit" type="submit" value="Submit" /></td>
                <td><input name="clear" type="reset" value="Clear" /></td></tr>
            </table>
    </xsl:element>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  Qsection   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qsection">
    <h3><xsl:value-of select="Qintro/Qheading"/></h3>
    <div><xsl:value-of select="Qintro/Qpara"/></div>
    <xsl:apply-templates select="Question"/>
    <hr/>       <!--Seperate different Sections-->
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  Question   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Question">
    <p/>
    <div><xsl:value-of select="substring-after(@qid,'-')"/><xsl:text>. </xsl:text>
    <xsl:value-of select="Qtext"/></div>

                   <!--Simple Choice(only one choice could be selected-->

    <xsl:if test="string(@kind)='simple-choice'">
    <xsl:apply-templates select="Qanswer/Qchoice" mode="simple-choice"/>
    <xsl:apply-templates select="Qanswer/Qother" />
    </xsl:if>

                   <!--Free Choice(allow one or more than one choice can be selected)-->
                   
    <xsl:if test="string(@kind)='free-choice'">
    <xsl:apply-templates select="Qanswer/Qchoice" mode="free-choice"/>
    </xsl:if>

                   <!--Comments-->

    <xsl:if test="string(@kind)='comments'">
    <xsl:apply-templates select="Qanswer" mode="comments"/>
    </xsl:if>
                   <!--Short Answer-->

    <xsl:if test="string(@kind)='short-answer'">
    <xsl:apply-templates select="Qanswer" mode="short-answer"/>
    </xsl:if>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  Qchoice(Simple-choice)  &&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qchoice" mode="simple-choice">
    <div>
               <!--Create Radio(input)-->
    <xsl:element name="input">
    <xsl:attribute name="type"><xsl:value-of select="'radio'"/></xsl:attribute>
    <xsl:attribute name="value"><xsl:value-of select="@val"/></xsl:attribute>
    <xsl:attribute name="name"><xsl:value-of select="../../@qid"/></xsl:attribute>
    </xsl:element>
    <xsl:value-of select="."/>
    </div>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  Qchoice(free-choice)  &&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qchoice" mode="free-choice">
    <div>
                   <!--Create Checkbox(input)-->
    <xsl:element name="input">
      <xsl:attribute name="type"><xsl:value-of select="'checkbox'"/></xsl:attribute>
      <xsl:attribute name="value"><xsl:value-of select="@val"/></xsl:attribute>
      <xsl:attribute name="name"><xsl:value-of select="../../@qid"/></xsl:attribute>
    </xsl:element>
    <xsl:value-of select="."/></div>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  Qother &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qother">
    <div>
                   <!--Create Radio(input)-->
    <xsl:element name="input">
      <xsl:attribute name="type"><xsl:value-of select="'radio'"/></xsl:attribute>
      <xsl:attribute name="value"><xsl:value-of select="'other'"/></xsl:attribute>
      <xsl:attribute name="name"><xsl:value-of select="../../@qid"/></xsl:attribute>
    </xsl:element>
    <xsl:value-of select="."/>       
               
                  <!--Create TEXT(input)-->

    <xsl:element name="input">
    <xsl:attribute name="type"><xsl:value-of select="'text'"/></xsl:attribute>
    <xsl:attribute name="value"><xsl:value-of select="''"/></xsl:attribute>
    <xsl:attribute name="name"><xsl:value-of select="../../@qid"/></xsl:attribute>
    <xsl:attribute name="size"><xsl:value-of select="'25'"/></xsl:attribute>
    <xsl:attribute name="maxlength"><xsl:value-of select="'25'"/></xsl:attribute>
    </xsl:element></div>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&   Qanswer(comments) &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qanswer" mode="comments">
    <div>
                   <!--Create TEXTAREA(input)-->
    <xsl:element name="textarea">
       <xsl:attribute name="name"><xsl:value-of select="../@qid"/></xsl:attribute>
       <xsl:attribute name="rows"><xsl:value-of select="'3'"/></xsl:attribute>
       <xsl:attribute name="cols"><xsl:value-of select="'50'"/></xsl:attribute>
    </xsl:element></div>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&  Qanswer(short-answer) &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <xsl:template match="Qanswer" mode="short-answer">
    <div>
                   <!--Create TEXT(input)-->
    <xsl:element name="input">
      <xsl:attribute name="type"><xsl:value-of select="'text'"/></xsl:attribute>
      <xsl:attribute name="value"><xsl:value-of select="''"/></xsl:attribute>
      <xsl:attribute name="name"><xsl:value-of select="../@qid"/></xsl:attribute>
      <xsl:attribute name="size"><xsl:value-of select="'25'"/></xsl:attribute>
      <xsl:attribute name="maxlength"><xsl:value-of select="'25'"/></xsl:attribute>
    </xsl:element></div>
    </xsl:template>

    <!--&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&-->
    <!--
    The following over-rides the default ' output text' template
    -->

    <xsl:template match="*">
    <!-- Do nothing!!! -->
    </xsl:template>

    </xsl:stylesheet>

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/16 19:37:00
     
     jx27 帅哥哟,离线,有人找我吗?
      
      
      等级:大二期末(汇编考了97分!)
      文章:37
      积分:447
      门派:XML.ORG.CN
      注册:2005/6/15

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jx27发送一个短消息 把jx27加入好友 查看jx27的个人资料 搜索jx27在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jx27的博客8
    发贴心情 
    还有XML源文件没有发上来,但是我觉得这个应该能够帮助楼主。

    IDEA应该都差不多。

    这个是我的作业,嘿嘿~~~~~

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/6/16 19:40:00
     
     smxwjd 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(猛啃高等数学)
      文章:13
      积分:132
      门派:XML.ORG.CN
      注册:2004/8/26

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给smxwjd发送一个短消息 把smxwjd加入好友 查看smxwjd的个人资料 搜索smxwjd在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看smxwjd的博客9
    发贴心情 
    ASP 可以实现,另MSXSL也很方便,你可以试试,他支持XSLT,Mode输出……

    ----------------------------------------------
    [URL=http://wpa.qq.com/msgrd?V=1&Uin=52852011&Site=oa.sanquan.com:1080&Menu=yes]QQ留言[/URL]/[URL=mailto:9911211@163.com]邮件[/URL] Service+XSL+XML+WML+VML=全方位服务

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

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

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    140.625ms