What is XSLT

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 outputWhat is XSLT_第1张图片

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:What is XSLT_第2张图片

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.What is XSLT_第3张图片

XSLT Functions

Template construct(What to do)

  • xsl: value - ofWhat is XSLT_第4张图片

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

  • xsl: for - each

     
  • xsl: if

     
  • 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

你可能感兴趣的:(xml,开发语言,xml)