XML Getting Started Tutorial: XSLT-XML/XSLT code example

Source: Internet
Author: User
Tags xslt xslt processor
XSLT is a part of XSL. it is an application of XML and specifies the rules for converting an XML document into another XML document. XSLT is an XML document and a style sheet containing a series of templates. The XSLT processor compares the elements in the input XML document with the templates in the style sheet. if they match, the XSLT in the template is a part of XSL, which is an application of XML, specify the rules for converting an XML document to another XML document. XSLT is an XML document and a style sheet containing a series of templates. The XSLT processor compares the elements in the input XML document with the templates in the style sheet. if they match
XSLT is a part of XSL. it is an application of XML and specifies the rules for converting an XML document into another XML document. XSLT is an XML document and a style sheet containing a series of templates. The XSLT processor compares the elements in the input XML document with the templates in the style sheet. if they match, the content of the template is written into an output tree. Complete
XSLT is a part of XSL. it is an application of XML and specifies the rules for converting an XML document into another XML document. XSLT is an XML document and a style sheet containing a series of templates. The XSLT processor compares the elements in the input XML document with the templates in the style sheet. if they match, the content of the template is written into an output tree. After processing, the output tree is serialized into an XML document or a document in other formats, such as HTML or rtf.
Several key terms of XSLT

  • SOURCE tree: the tree of elements and content in the original document.

  • Result tree: the tree of elements and content in the converted document.

  • Template rules: the basis of the XSLT style table, divided into two parts: pattern and template. The entire xsl: template element.

  • The condition set that matches the elements in the source tree with the pattern rule. Xsl: the value of match in template.

  • Template: the part of the result tree to be instantiated when the template rules are applied. Xsl: content in the template element.

  • XSLT defines 35 elements in three categories:

  • Two root elements

    • Xsl: The root element of stylesheet. XSLT is also an XML document. the root element of this document is xsl: stylesheet. All XSLT elements belong to the namespace xmlns: xsl = "http://www.w3.org/1999/XSL/Transform", so all XSLT elements have the xsl prefix. A minimal XSLT document:

    •     
          
    • Xsl: the transform element.

    • 13 top-level elements can be directly used as child elements of the root element, including:

      • Xsl: apply-imports xsl: attribute-set xsl: decimal-format xsl: import xsl: include xsl: key xsl: namespace-alias xsl: output xsl: param xsl: preserve-space xsl: strip-space xsl: template element, used to match elements in XML documents. For example:
             
              
        Match the person element in the XML document. Xsl: variable
             

      • 20 instruction elements

        • Xsl: apply-imports xsl: apply-template applies the template element to display the specified element value (content ). For example:
                
                 
          To display the value of the name element. Xsl: attribute xsl: call-template xsl: choose xsl: comment xsl: copy-of xsl: element xsl: fallback xsl: for-each xsl: if xsl: message xsl: number xsl: otherwise xsl: processing-instruction xsl: text xsl: value-of select element, used to calculate the value (content) of the element ). For example:
                 
                  
          To obtain the value (content) of the name element in the XML document ). Xsl: variable xsl: when XSLT function
                 
                

The above is the XML Getting Started Tutorial: XSLT-XML/XSLT code details of the instance, more please pay attention to the first PHP community other related articles!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.