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

    >> 本版讨论SVG, GML, X3D, VRML, VML, XAML, AVALON, Batik等基于XML的图形技术,以及有关GIS的应用。
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - 高级XML应用『 SVG/GML/VRML/X3D/XAML 』 → 用xml数据自动生成svg 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4495 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 用xml数据自动生成svg 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     zhengminxin 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:6
      积分:76
      门派:XML.ORG.CN
      注册:2007/6/29

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给zhengminxin发送一个短消息 把zhengminxin加入好友 查看zhengminxin的个人资料 搜索zhengminxin在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看zhengminxin的博客楼主
    发贴心情 用xml数据自动生成svg

    相信各位都已经读过IBM上的这个例子(https://www6.software.ibm.com/developerworks/cn/education/xml/x-iactsvg/tutorial/index.html)

    这是个用SVG创建楼层平面图的例子,其中有用到xslt转换xml数据自动生成svg,可是在我的机器上看不到正确的结果,请问各位大侠是什么原因?


       收藏   分享  
    顶(0)
      




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

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给zhengminxin发送一个短消息 把zhengminxin加入好友 查看zhengminxin的个人资料 搜索zhengminxin在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看zhengminxin的博客2
    发贴心情 
    room.xml文件内容

    <?xml   version='1.0'?>
    <?xml-stylesheet   href="room.xsl"   type="text/xsl"?>
    <RoomData>
      <Room   position="1"   type="Standard"   width="40"   depth="25"   />
      <Room   position="2"   type="Standard"   width="40"   depth="22"   />
      <Room   position="3"   type="Standard"   width="40"   depth="25"   />
    </RoomData>

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

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给zhengminxin发送一个短消息 把zhengminxin加入好友 查看zhengminxin的个人资料 搜索zhengminxin在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 引用回复这个贴子 回复这个贴子 查看zhengminxin的博客3
    发贴心情 
    room.xsl文件内容

    <?xml   version='1.0'?>
    <xsl:stylesheet   version="1.0"     
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"   
                    xmlns:xlink="http://www.w3.org/1999/xlink"   
                    xmlns="http://www.w3.org/2000/svg">
      <xsl:output   method="xml"   indent="yes"   encoding="UTF-8"   />

      <xsl:template   match="/">

        <svg   xmlns:xlink="http://www.w3.org/1999/xlink"     
                    xmlns="http://www.w3.org/2000/svg"   
                    width="1200px"   height="250px"   viewBox="0   0   400   250"     
                    id="RoomsSVG">

          <g   id="mover"   transform="translate(-400,0)">
            <xsl:apply-templates   select="Room"   />
          </g>
        </svg>
      </xsl:template>

      <xsl:template   match="Room">
        <xsl:element   name="svg">
          <xsl:attribute   name="id">
            <xsl:value-of     
                      select="concat('Room10',   @position)"   />
          </xsl:attribute>
          <xsl:attribute   name="width">
            <xsl:value-of     
                      select="(10   *   @width)"   />px
          </xsl:attribute>
          <xsl:attribute   name="height">
            <xsl:value-of     
                      select="(10   *   @depth)"   />px
          </xsl:attribute>
          <xsl:attribute   name="x">
            <xsl:value-of     
                      select="concat(((@position   -   1)   *   400),   'px')"   />
          </xsl:attribute>
          <xsl:attribute   name="y">0px</xsl:attribute>

          <xsl:element   name="rect">
            <xsl:attribute   name="id">
              <xsl:value-of   
                      select="concat('Room10',   @position,   'Rect')"   />
            </xsl:attribute>
            <xsl:attribute   name="width">100%</xsl:attribute>
            <xsl:attribute   name="height">100%</xsl:attribute>
            <xsl:choose>
              <xsl:when   test="@position='1'">
                <xsl:attribute   name="fill">#CCCCFF</xsl:attribute>
              </xsl:when>
              <xsl:when   test="@position='2'">
                <xsl:attribute   name="fill">#CCFFCC</xsl:attribute>
              </xsl:when>
              <xsl:when   test="@position='3'">
                <xsl:attribute   name="fill">#FFCC00</xsl:attribute>
              </xsl:when>
            </xsl:choose>
            <xsl:attribute   name="stroke">black</xsl:attribute>
            <xsl:attribute   name="stroke-width">5</xsl:attribute>
          </xsl:element>
          <!--   End   of   rect   Element   -->
          <xsl:element   name="text">
            <xsl:attribute   name="id">
              <xsl:value-of     
                      select="concat('Room10',   @position,   'Label')"   />
            </xsl:attribute>
            <xsl:attribute   name="font-size">24pt</xsl:attribute>
            <xsl:attribute   name="x">55px</xsl:attribute>
            <xsl:attribute   name="y">100px</xsl:attribute>
            <xsl:attribute   name="fill">black</xsl:attribute>
            Room   10<xsl:value-of   select="@position"   />
          </xsl:element>
          <!--   End   of   first   text   Element   -->

          <xsl:element   name="text">
            <xsl:attribute   name="id">
              <xsl:value-of     
                      select="concat('Room10',   @position,   'Type')"   />
            </xsl:attribute>
            <xsl:attribute   name="font-size">24pt</xsl:attribute>
            <xsl:attribute   name="x">55px</xsl:attribute>
            <xsl:attribute   name="y">150px</xsl:attribute>
            <xsl:attribute   name="fill">black</xsl:attribute>
            <xsl:value-of   select="@type"   />   office
          </xsl:element>
          <!--   End   of   second   text   Element   -->

          <xsl:element   name="a">
            <xsl:attribute   name="xlink:href">Rooms2ndFloor.html</xsl:attribute>

            <xsl:element   name="text">
              <xsl:attribute   name="id">
                <xsl:value-of     
                      select="concat('Room10',   @position,   'Link')"   />
              </xsl:attribute>
              <xsl:attribute   name="font-size">15pt</xsl:attribute>
              <xsl:attribute   name="x">55px</xsl:attribute>
              <xsl:attribute   name="y">200px</xsl:attribute>
              <xsl:attribute   name="fill">black</xsl:attribute>
              Click   to   view   2nd   Floor
            </xsl:element>
            <!--   End   of   third   text   Element   -->

          </xsl:element>
          <!--   End   of   the   <a>   Element   -->

        </xsl:element>
        <!--   End   of   nested   svg   Element   -->
      </xsl:template>

    </xsl:stylesheet>

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/6/29 11:38:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 SVG/GML/VRML/X3D/XAML 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/19 13:52:02

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

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