XSLT is used to implement table output of unknown XML table fields,

Source: Internet
Author: User
Tags xslt
<? XML version = "1.0" encoding = "UTF-8" ?>
< XSL: stylesheet Version = "1.0" Xmlns: XSL = "Http://www.w3.org/1999/XSL/Transform" >
< XSL: Template Match = "/" >
< Table Cellspacing = "0" Cellpadding = "5" Align = "Center" Rules = "All" Border = "1" Style = "Border-width: 1px; border-style: solid; font-size: 9pt; width: 80%; border-collapse: collapse ;" >
< Tr >
<! -- Output header information -->
< XSL: Apply-templates Select = "/TOOLKIT/rtable [1]/*" Mode = "Title" />
</ Tr >
< XSL: For-each Select = "/TOOLKIT/rtable" >
< Tr >
<! -- Output data of each row -->
< XSL: Variable Name = "P" Select = "Position ()" />
< XSL: Apply-templates Select = "/TOOLKIT/rtable [position () = $ p]/*" Mode = "Itemdetail" />
</ Tr >
</ XSL: For-each >
</ Table >
</ XSL: Template >
< XSL: Template Match = "/TOOLKIT/rtable [1]/*" Mode = "Title" >
< TD Align = "Char" Bgcolor = "#999999" >
< B >
< XSL: value- Select = "Local-Name ()" />
</ B >
</ TD >
</ XSL: Template >
< XSL: Template Match = "/TOOLKIT/rtable /*" Mode = "Itemdetail" >
< TD >
< XSL: Text Disable-output-escaping = "Yes" > & Amp; Nbsp; </ XSL: Text >
< XSL: value- Select = "." />
</ TD >
</ XSL: Template >
</ XSL: stylesheet >

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.