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

    >> 本版讨论XSL,XSLT,XSL-FO,CSS等技术
    [返回] 计算机科学论坛XML.ORG.CN讨论区 - XML技术『 XSL/XSLT/XSL-FO/CSS 』 → 请教:以下XML文件中如何设定时间 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 2723 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 请教:以下XML文件中如何设定时间 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     ckearth 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:0
      积分:52
      门派:XML.ORG.CN
      注册:2005/11/16

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给ckearth发送一个短消息 把ckearth加入好友 查看ckearth的个人资料 搜索ckearth在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看ckearth的博客楼主
    发贴心情 请教:以下XML文件中如何设定时间

    请教:以下XML文件中如何设定时间
                       <valid-from></valid-from>
     <valid-to></valid-to>
     <maintenance-to></maintenance-to>

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <!-- edited with XMLSpy v2006 sp1 U (http://www.altova.com) by  () -->
    <!-- Use a standards compliant web browser to view this file-->
    <!-- This is a working license-->
    <?xml-stylesheet type="text/xsl" href="D:\Mastercam HSM Performance Pack\stylesheets\license.xsl"?>
    <license xmlns="http://www.cimco-software.com/xml/2003/license/1.0">
     <product>Mastercam HSM Performance Pack Release 1</product>
     <company>ckearth</company>
     <department>robot</department>
     <email>ckearth@126.com</email>
     <domain>robot</domain>
     <address>outangwuxi</address>
     <reseller>cimco</reseller>
     <issued-by>cimco</issued-by>
     <valid-from></valid-from>
     <valid-to></valid-to>
     <maintenance-to></maintenance-to>
     <constraints>
      <dongle name="1" type="industrial"/>
     </constraints>
     <components>
      <component name="Mastercam HSM Performance Pack Release 1" number="1"/>
     </components>
    </license>

    才能用XSL文件看到时间

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>

    <!--
      Copyright (c) 2003, 2004 by CIMCO Integration
      http://www.cimco-software.com
      All rights reserved

      $Revision: $
      $Date: $
    -->

    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:license="http://www.cimco-software.com/xml/2003/license/1.0">

    <xsl:output method="html" encoding="utf-8"/>

    <xsl:template match="/">
      <html>
        <xsl:apply-templates select="license:license"/>
      </html>
    </xsl:template>

    <xsl:template match="license:license">
      <head>
        <title><xsl:text>License for </xsl:text><xsl:value-of select="@product"/></title>
      </head>
      <body>
        <h2>Licensee Information</h2>

        <xsl:apply-templates select="license:company"/>
        <xsl:apply-templates select="license:department"/>
        <xsl:apply-templates select="license:email"/>
        <xsl:apply-templates select="license:domain"/>

        <xsl:apply-templates select="license:address"/>

        <xsl:apply-templates select="license:reseller"/>

        <h2>Issue Information</h2>
        <xsl:apply-templates select="license:issued-by"/>
        <xsl:apply-templates select="license:valid-from"/>
        <xsl:apply-templates select="license:valid-to"/>
        <xsl:apply-templates select="license:maintenance-to"/>

        <xsl:apply-templates select="license:constraints"/>

        <xsl:apply-templates select="license:components"/>
      </body>
    </xsl:template>

    <xsl:template match="license:constraints">
      <h2>Constraints</h2>

      <p><xsl:text>The license has been issued for use under the following constraints.</xsl:text></p>

      <h3><xsl:text>The following security devices are activated by the license</xsl:text></h3>
      <xsl:if test="count(license:dongle)!=0">
        <ul>
          <xsl:apply-templates select="license:dongle">
            <xsl:sort data-type="number" select="@name"/>
          </xsl:apply-templates>
        </ul>
      </xsl:if>
      <xsl:if test="count(license:dongle)=0">
        <p><xsl:text>No dongles.</xsl:text></p>
      </xsl:if>
    </xsl:template>

    <xsl:template match="license:components">
      <h2><xsl:text>Components</xsl:text></h2>

      <p><xsl:text>The following components of the product are activated.</xsl:text></p>

      <xsl:if test="count(license:component[@name='CIMCO License Manager'])&gt;0">
        <p>This is a floating license for use with CIMCO License Manager.</p>
      </xsl:if>

      <ul>
        <xsl:apply-templates select="license:component"/>
      </ul>
    </xsl:template>

    <xsl:template name="dongle">
      <xsl:param name="name" select="''"/>
      <xsl:param name="type" select="''"/>
      <xsl:param name="network" select="''"/>
      <xsl:param name="licenses" select="''"/>

      <xsl:variable name="type-text">
        <xsl:choose>
          <xsl:when test="$type='dealer'">
            <xsl:text>Mastercam dealer HASP</xsl:text>
          </xsl:when>
          <xsl:when test="$type='educational'">
            <xsl:text>Mastercam educational HASP</xsl:text>
          </xsl:when>
          <xsl:when test="$type='industrial'">
            <xsl:text>Mastercam industrial HASP</xsl:text>
          </xsl:when>
          <xsl:when test="$type='hsm'">
            <xsl:text>HSM HASP</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>invalid</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>

      <li>
        <xsl:choose>
          <xsl:when test="$network='yes'">
            <b><xsl:value-of select="$name"/></b><xsl:text> (</xsl:text><xsl:value-of select="$type-text"/><xsl:text> - network with </xsl:text><xsl:value-of select="$licenses"/> level 3 milling licenses<xsl:text>). See activated floating licenses below.</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <b><xsl:value-of select="$name"/></b><xsl:text> (</xsl:text><xsl:value-of select="$type-text"/><xsl:text>)</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </li>

    </xsl:template>

    <xsl:template match="license:dongle">
      <xsl:call-template name="dongle">
        <xsl:with-param name="name" select="@name"/>
        <xsl:with-param name="type" select="@type"/>
        <xsl:with-param name="network" select="@network"/>
        <xsl:with-param name="licenses" select="@licenses"/>
      </xsl:call-template>
    </xsl:template>

    <xsl:template match="license:issued-by">
      <p><b><xsl:text>Issued by: </xsl:text></b><xsl:value-of select="."/></p>
    </xsl:template>

    <xsl:template match="license:valid-from">
      <p><b><xsl:text>Valid from: </xsl:text></b><xsl:value-of select="@day"/><xsl:text>. </xsl:text><xsl:call-template name="get-month-name"><xsl:with-param name="index" select="@month"/></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="@year"/></p>
    </xsl:template>

    <xsl:template match="license:valid-to">
      <xsl:choose>
        <xsl:when test="@day=1 and @month=1 and @year=3000">
          <p><b><xsl:text>Valid to:</xsl:text></b><xsl:text> never expires</xsl:text></p>
        </xsl:when>
        <xsl:otherwise>
          <p><b><xsl:text>Valid to: </xsl:text></b><xsl:value-of select="@day"/><xsl:text>. </xsl:text><xsl:call-template name="get-month-name"><xsl:with-param name="index" select="@month"/></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="@year"/></p>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>

    <xsl:template match="license:maintenance-to">
      <p><b><xsl:text>Maintenance to: </xsl:text></b><xsl:value-of select="@day"/><xsl:text>. </xsl:text><xsl:call-template name="get-month-name"><xsl:with-param name="index" select="@month"/></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="@year"/></p>
    </xsl:template>

    <xsl:template match="license:company">
      <p><b><xsl:text>Company: </xsl:text></b><xsl:value-of select="."/></p>
    </xsl:template>

    <xsl:template match="license:department">
      <p><b><xsl:text>Department: </xsl:text></b><xsl:value-of select="."/></p>
    </xsl:template>

    <xsl:template match="license:email">
      <p><b><xsl:text>E-mail: </xsl:text></b><xsl:value-of select="."/></p>
    </xsl:template>

    <xsl:template match="license:domain">
      <p><b><xsl:text>Domain: </xsl:text></b><xsl:value-of select="."/></p>
    </xsl:template>

    <xsl:template match="license:address">
      <p><b><xsl:text>Address:</xsl:text></b></p>
      <pre><xsl:value-of select="."/></pre>
    </xsl:template>

    <xsl:template match="license:reseller">
      <h2>Support Information</h2>
      <pre><xsl:value-of select="."/></pre>
    </xsl:template>

    <xsl:template name="get-month-name">
      <xsl:param name="index"/>
      <xsl:choose>
        <xsl:when test="$index=1">
          <xsl:text>January</xsl:text>
        </xsl:when>
        <xsl:when test="$index=2">
          <xsl:text>February</xsl:text>
        </xsl:when>
        <xsl:when test="$index=3">
          <xsl:text>March</xsl:text>
        </xsl:when>
        <xsl:when test="$index=4">
          <xsl:text>April</xsl:text>
        </xsl:when>
        <xsl:when test="$index=5">
          <xsl:text>May</xsl:text>
        </xsl:when>
        <xsl:when test="$index=6">
          <xsl:text>June</xsl:text>
        </xsl:when>
        <xsl:when test="$index=7">
          <xsl:text>July</xsl:text>
        </xsl:when>
        <xsl:when test="$index=8">
          <xsl:text>August</xsl:text>
        </xsl:when>
        <xsl:when test="$index=9">
          <xsl:text>September</xsl:text>
        </xsl:when>
        <xsl:when test="$index=10">
          <xsl:text>October</xsl:text>
        </xsl:when>
        <xsl:when test="$index=11">
          <xsl:text>November</xsl:text>
        </xsl:when>
        <xsl:when test="$index=12">
          <xsl:text>December</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$index"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>

    <xsl:template match="license:component">
      <xsl:variable name="floating" select="count(//license:component[@name='CIMCO License Manager'])&gt;0"/>

      <li>
        <b><xsl:value-of select="@name"/></b>
        <xsl:variable name="count">
          <xsl:choose>
            <xsl:when test="@number">
              <xsl:value-of select="@number"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="1"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:if test="$floating">
          <xsl:text> (</xsl:text>
          <b><xsl:value-of select="$count"/></b>
          <xsl:text> </xsl:text>
          <xsl:choose>
            <xsl:when test="$count=1">
              <xsl:text>floating license</xsl:text>
            </xsl:when>
            <xsl:otherwise>
              <xsl:text>floating licenses</xsl:text>
            </xsl:otherwise>
          </xsl:choose>
          <xsl:text>)</xsl:text>
        </xsl:if>
      </li>
    </xsl:template>

    </xsl:stylesheet>


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/11/16 13:45: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/30 11:36:57

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

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