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

    >> 本版讨论XSL,XSLT,XSL-FO,CSS等技术
    [返回] 计算机科学论坛XML.ORG.CN讨论区 - XML技术『 XSL/XSLT/XSL-FO/CSS 』 → [求助] 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4719 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [求助] 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     JeffreyXu 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:61
      门派:XML.ORG.CN
      注册:2008/1/27

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

    那位能帮我解释一下这句语句的意思啊
    <xsl:for-each select="following-sibling::CodeListing[ count(preceding-sibling::CodeTitle[1] | current()) = 1]">

       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/1/27 11:19:00
     
     enyaxp 帅哥哟,离线,有人找我吗?巨蟹座1984-7-4
      
      
      威望:2
      等级:计算机学士学位(版主)
      文章:350
      积分:2433
      门派:XML.ORG.CN
      注册:2007/12/11

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给enyaxp发送一个短消息 把enyaxp加入好友 查看enyaxp的个人资料 搜索enyaxp在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 点击这里发送电邮给enyaxp  引用回复这个贴子 回复这个贴子 查看enyaxp的博客2
    发贴心情 
    好诡异的表达式...

    首先将表达式分解:
    S1 = following-sibling::CodeListing[S2];
    S2 = count(S3 | current()) = 1;
    S3 = preceding-sibling::CodeTitle[1];

    S1表示选择当前上下文节点的所有名为"CodeListing"并满足S2的兄弟元素;
    S2是一种常用句式,count(x|y)=1,用于判断两节点是否相同;
      这里表示要求满足S3的节点和“当前”节点相同。
      注意,current()表示的“当前”节点是S1的当前上下文节点,而不是S2的上下文节点"CodeListing"!
    S3表示当前CodeListing节点的前一个名为"CodeTitle"兄弟节点;

    也就是说这个select要选中的是一个CodeListing节点,这个节点的前一个CodeTitle兄弟节点要和当前节点相同!

    如果方便的话把对应的XML贴出来,不然现在还不确定这段代码要做什么.

    ----------------------------------------------

    I'M BACK, NEVER GO AWAY.

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/1/27 17:08:00
     
     JeffreyXu 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:61
      门派:XML.ORG.CN
      注册:2008/1/27

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给JeffreyXu发送一个短消息 把JeffreyXu加入好友 查看JeffreyXu的个人资料 搜索JeffreyXu在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看JeffreyXu的博客3
    发贴心情 
    谢谢你解释
    <xsl:apply-templates select="following-sibling::Para[ count(preceding-sibling::Title1[1] | current()) = 1]" />这句和前面那一句一样的,我也没理解,也是同一个xsl内的。因为XML太长,所以贴一部分出来,这部分是这一句需要解释的:

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="xslt_tools_full.xsl" ?>

    <Word-Document>
     <ChapterTitle>
      <p>Finding and Using XSLT Tools</p>
     </ChapterTitle>
     <Para>
      <p>The XSLT transformation process always begins with a reading of an XML document, generally by a separate component called an XML parser or processor. The XML processor reads your input (see Chapter 1 for specifics on processing order) and verifies that the XSLT and XML documents are both well-formed. </p>
      <p>I've included a list of common XML processors because of the necessity of having one for XSLT. </p>
      <p>There are certain configurations of XML and XSLT processors that have become fairly standard within the industry. For example, the Xerces/Xalan combination probably has the most support for the J2EE platform (the Java platform for enterprise-level web sites), but it is hardly your only option. What makes it a nice combination is the simple fact that most J2EE application servers build their architecture around Xerces and Xalan, and therefore remove a ton of configuration chores from the developer. Java being what it is, you can always add your own XML parser/XSLT processor combination; it just requires some extra configuration time.</p>
      <p>Your choice of XSLT processors is going to be a subjective one based on a number of criteria. Heavy duty server-side transactions require caching mechanisms that generally fall outside the purvey of the XSLT processor, and are actually managed by other components in modern XSL Transformation systems. An example of this are the supporting classes for XML in Java, which have improved XSLT performance significantly over the last couple of years simply by introducing caching functions. The latest edition of MSXML does the same thing. MSXML and the JAVA API for XML consist of much more than an XML parser and XSLT processor, and feature a wide variety of performance-enhancing components that allow you to do everything from stream to HTTP to work with SAX (Simple API for XML) and DOM (The Document Object Model). </p>
      <p>At first glance there may appear to be a bias towards Microsoft's MSXML engine, but in truth most of the parsers and processors named in this appendix require little warning, and using them is pretty straightforward. They usually come with sufficient documentation, and have survived the test of time. The MSXML parser, on the other hand, is replete with versioning conflicts, and I've provided some tables to help you deal with them. Microsoft's early adoption of XML has had many good benefits, but it has come at a price for XSLT developers. </p>
      <p>The bottom line is that every application that appears in these pages is pretty good. The state of XML software development is very good these days, and competition is pretty fierce. Anything that appears in these pages is going to be reliable. And what about software that doesn't appear in these pages? That doesn't necessarily mean I tried it and didn't like it. The industry has so many good developers that there is a good chance I just missed it. Email me if you want your software listed in the next edition, or if you feel I missed something. Chance are, I have.</p>
     </Para>
     <Title1>
      <p>XML Parsers</p>
     </Title1>
     <Para>
      <p>The following is a list of XML Parsers. Installation of each depends on the environment, but I haven't encountered a parser that doesn't include easy-to-read instructions. Java programs require a Java Virtual Machine on your computer, and if you are on Windows many of them consist of installation routines that build your class paths for you. If you are on UNIX, Linux or Macintosh, you usually need to handle your class paths yourself. If you don't know Java at all, you might want to visit a tutorial site to at least learn the basics behind how it works, even if you don't want to learn how to program with it. Class path management is a bit of an art. Here is one tutorial you might want to look at:</p>

     </Para>
     <CodeSnippet_sp>
      <p>http://www.mike-levin.com/learning-java/toc.html</p>
     </CodeSnippet_sp>
     <RunInHead>
      <p>EXML (Eiffel) </p>
     </RunInHead>
     <RunInPara>
      <p>An XML 1.0 parser for Eiffel based on expat</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://exml.sourceforge.net/</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>expat - XML Parser Toolkit</p>
     </RunInHead>
     <RunInPara>
      <p>A non-validating XML 1.0 parser written in C.</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://www.jclark.com/xml/expat.html</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>fxp </p>
     </RunInHead>
     <RunInPara>
      <p>A validating XML parser written in the functional programming language SML.</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://www.informatik.uni-trier.de/~aberlea/Fxp/</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>HXML</p>
     </RunInHead>
     <RunInPara>
      <p>A non-validating parser for Haskell</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://www.flightlab.com/~joe/hxml</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>Java API for XML Parsing</p>
     </RunInHead>
     <RunInPara>
      <p>Sun's Java API for XML</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://java.sun.com/xml/index.html</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>Larval</p>
     </RunInHead>
     <RunInPara>
      <p>A validating XML processor built on the same code base as Lark, which is a non-validating XML processor implemented in the Java language</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://www.textuality.com/Lark/</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>Lotus Notes/Domino XML Toolkit</p>
     </RunInHead>
     <RunInPara>
      <p>Extends XML  support in Lotus Notes client and Domino Application Server, allowing content in a Domino database to be created and processed as native XML.</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://www.lotus.com/developers/devbase.nsf/homedata/homexmltk</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>LTXML</p>
     </RunInHead>
     <RunInPara>
      <p>LT XML is an integrated set of XML tools and a developers' tool-kit with a C-based API for UNIX and WIN32 ports.</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://www.ltg.ed.ac.uk/software/xml/</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>MSXML</p>
     </RunInHead>
     <RunInPara>
      <p>Microsoft's latest parser</p>
     </RunInPara>
     <CodeSnippetSub>
      <p>http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000438</p>
     </CodeSnippetSub>
     <RunInHead>
      <p>SXP </p>
     </RunInHead>

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/1/27 20:42:00
     
     enyaxp 帅哥哟,离线,有人找我吗?巨蟹座1984-7-4
      
      
      威望:2
      等级:计算机学士学位(版主)
      文章:350
      积分:2433
      门派:XML.ORG.CN
      注册:2007/12/11

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给enyaxp发送一个短消息 把enyaxp加入好友 查看enyaxp的个人资料 搜索enyaxp在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 点击这里发送电邮给enyaxp  引用回复这个贴子 回复这个贴子 查看enyaxp的博客4
    发贴心情 
    要匹配模版,匹配条件和上面的那句类似,所以就按上面的分析,最终找到节点如下:

    <Title1>
      <p>XML Parsers</p>
    </Title1>

    如果没分析错的话你xsl里面应该有

      <xsl:template match="Title1">
         ......
      </xsl:template>
    匹配的就是这个模版。

    ----------------------------------------------

    I'M BACK, NEVER GO AWAY.

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/1/27 22:46:00
     
     Qr 帅哥哟,离线,有人找我吗?
      
      
      威望:9
      等级:博士二年级(版主)
      文章:4392
      积分:29981
      门派:XML.ORG.CN
      注册:2004/5/15

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给Qr发送一个短消息 把Qr加入好友 查看Qr的个人资料 搜索Qr在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 访问Qr的主页 引用回复这个贴子 回复这个贴子 查看Qr的博客5
    发贴心情 
    XPath方面的知识,要多看看。

    ----------------------------------------------
    没人帮忙,那就靠自己,自己才是最好的老师!本人拒绝回答通过站内短消息提出的问题!

    blog:http://Qr.blogger.org.cn

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/1/28 12:11:00
     
     JeffreyXu 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:61
      门派:XML.ORG.CN
      注册:2008/1/27

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给JeffreyXu发送一个短消息 把JeffreyXu加入好友 查看JeffreyXu的个人资料 搜索JeffreyXu在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 引用回复这个贴子 回复这个贴子 查看JeffreyXu的博客6
    发贴心情 
    没错!是有
    <xsl:template match="Title1">
         ......
    </xsl:template>
    看了你的分析明了了许多,谢谢
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/1/29 20:48:00
     
     enyaxp 帅哥哟,离线,有人找我吗?巨蟹座1984-7-4
      
      
      威望:2
      等级:计算机学士学位(版主)
      文章:350
      积分:2433
      门派:XML.ORG.CN
      注册:2007/12/11

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给enyaxp发送一个短消息 把enyaxp加入好友 查看enyaxp的个人资料 搜索enyaxp在『 XSL/XSLT/XSL-FO/CSS 』的所有贴子 点击这里发送电邮给enyaxp  引用回复这个贴子 回复这个贴子 查看enyaxp的博客7
    发贴心情 
    不客气,有什么问题再来问。

    ----------------------------------------------

    I'M BACK, NEVER GO AWAY.

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

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

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