What is XSLT

发布时间:2023年12月26日

XSL(eXtensible Stylesheet Lauguage) is a styling language for XML

is a styling language for XML

XSLT

stands for stands for XSL Transformations.

  • XSL/XSLT are XML based languages.

  • XSL / XSLT allows us to convert one XML structured document into another (data formatting)

  • XSLT is the most common part and it is supported in most web browsers

What is XSL(T)

XSLT is a pattern matching language(rather than a procedural language) that uses templates to generate an output

XSLT Basics

  • XSLT processes nodes of XML document.

    • Uses patten matching to identify the nodes.

    • Performs transformation on those nodes

    • Create a new documents

  • Type of XSLT nodes

    • Document

    • Processing Instruction

    • ELement

    • Attribute

    • Text

    • Namespace

    • Comment

  • XSLT templates

    • Describe the output based on the matched pattern.

    • Templates can be invoked:

Calling templates

  • Can be called by name or by matching nodes against a pattern

  • It's a declaration, so appears as a child node of the stylesheet element.

XSLT Functions

Template construct(What to do)

  • xsl: value - of

    Note: if multiple values are returned, value-of only returns the first node value

  • xsl: for - each

     <xsl:for-each select=“nodePattern”/>
  • xsl: if

     <xsl:if test=“condition”>
  • xsl: choose

     <xsl:choose> 
        <xsl:when test=“condition”> ?<xsl:when>
        <xsl:otherwise> </xsl:otherwise>
     </xsl:choose>
  • xsl: apply - templates

XSLT Function

  • ceiling() round decimal up to the nearest integer.

  • floor() round decimal down to the nearest integer.

  • count() determine the quantity in a set.

  • sum() add numbers together

文章来源:https://blog.csdn.net/weixin_74783792/article/details/135222769
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。