English 中文(简体)
xsl: 可变化中 < step> 的含义是什么?
原标题:what s the meaning of <step> in xsl:variable?

我不知道 xsl:可变 中的“ 步骤” 。 如果有人能解释“ 步骤” 的话,我将不胜感激。

以下XSLT 仅包括根元素中的2个元素。

xsl:output define the output format; xsl:variable define the variable ;

这个代码是如何解析的?这个代码代表什么?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:saxon="http://saxon.sf.net/"
  version="2.0"
  extension-element-prefixes="saxon">

  <xsl:output method="html" omit-xml-declaration="yes"
    encoding="utf-8" indent="no"/>

  <!-- <xsl:output method="xml" omit-xml-declaration="no"
    encoding="utf-8" indent="no"/> -->

  <xsl:variable name="processes">
    <!-- exclude elements with @specific-use= print-only  -->
    <step>prep/jpub3-webfilter.xsl</step>
    <!-- format citations in NLM/PMC format -->
    <step>citations-prep/jpub3-PMCcit.xsl</step>
    <!-- convert into HTML for display -->
    <step>main/jpub3-html.xsl</step>
  </xsl:variable>

  <xsl:include href="main/shell-utility.xsl"/>

</xsl:stylesheet>

补充 " 贝壳功用.xsl"

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:saxon="http://saxon.sf.net/"
  version="2.0"
  extension-element-prefixes="saxon">

  <!-- This stylesheet does not stand alone! It is a component
       to be called into XSLT 2.0 shell stylesheets. -->

  <xsl:variable name="document" select="/" saxon:assignable="yes"/>

  <xsl:param name="runtime-params">
    <base-dir>
      <xsl:value-of
        select="replace(base-uri(/),  /[^/]+$ ,  )"/>     
    </base-dir>
  </xsl:param>

  <xsl:template match="/">
    <xsl:for-each select="$processes/step/concat( ../ ,.)">
      <xsl:message>
        <xsl:text>&#xA;... Applying </xsl:text>
        <xsl:value-of select="."/>
      </xsl:message>
      <saxon:assign name="document"
        select="saxon:transform(
                  saxon:compile-stylesheet(doc(.)),
                  $document,
                  $runtime-params/* )"/>
      <!-- A third argument to saxon:transform could specify
           runtime parameters for any (or all) steps -->
    </xsl:for-each>
    <xsl:sequence select="$document"/>
    <xsl:message>&#xA;... Done</xsl:message>
  </xsl:template>

</xsl:stylesheet>
问题回答

代码刚刚创建了一个名为 processes 的变量, 并指定了一个包含三个 lt; step> 元素的节点列表。 就 XSL 解析器而言, < code>; step> 元素本身没有意义 。

这个代码代表什么?

 <xsl:variable name="processes">     
  <!-- exclude elements with @specific-use= print-only  -->     
  <step>prep/jpub3-webfilter.xsl</step>     
  <!-- format citations in NLM/PMC format -->     
  <step>citations-prep/jpub3-PMCcit.xsl</step>     
  <!-- convert into HTML for display -->     
  <step>main/jpub3-html.xsl</step>   
 </xsl:variable>

这是名为 processes 和类型 document-node() -- -- 的全局变量的定义 -- -- 其值是一个临时树,包含文档节点的子元素中的三个 step 元素。

How this variable is used depends on the code of the included stylesheet module that resides at: main/shell-utility.xsl. Because this code isn t provided , nothing can be said about the real usage of the processes variable.





相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签