📜  XSLT

📅  最后修改于: 2020-11-09 05:51:59             🧑  作者: Mango


定义了一种重用模板的方法,以便为特定类型/上下文的节点生成所需的输出。

宣言

以下是元素的语法声明。


属性

Sr.No Name & Description
1

name

Name of the element on which template is to be applied.

2

match

Pattern which signifies the element(s) on which template is to be applied.

3

priority

Priority number of a template. Matching template with low priority is not considered in from in front of high priority template.

4

mode

Allows element to be processed multiple times to produce a different result each time.

元素

Number of occurrences Unlimited

Parent elements

xsl:stylesheet, xsl:transform

Child elements

xsl:apply-imports,xsl:apply-templates,xsl:attribute, xsl:call-template, xsl:choose, xsl:comment, xsl:copy, xsl:copy-of, xsl:element, xsl:fallback, xsl:for-each, xsl:if, xsl:message, xsl:number, xsl:param, xsl:processing-instruction, xsl:text, xsl:value-of, xsl:variable, output elements

示范范例

此模板规则具有一种模式,该模式标识元素并以表格格式产生输出。

students.xml

 
 
 
    
      Dinkar 
      Kad 
      Dinkar 
      85 
    
    
      Vaneet 
      Gupta 
      Vinni 
      95 
    
    
      Jasvir 
      Singh 
      Jazz 
      90 
    

students_imports.xsl

 
  
    
     

输出

格式化输出