Role of XSL: Convert XML into HTML
The following is a part of the XML document:
empire burlesque Bob Dylan USA Columbia 10.90 1985 ...
Then, we use the following XSL file as an HTML template to convert XML data to an HTML file:
title
2 XSLT Element 1. xsl: If: A simple condition judgment element.
1. declaration method:
Test = boolean-Expression>
Partial attribute description:
2. Test
A logical expression. if it is true, the operation expressed by the content of xsl: if
1. Use of templates
Some encoding tables are stored in the database, but some Chinese characters are displayed.
In this case, we can define an XSL file that stores data. I have defined a codetab. XSL
Reference this file to the archive. XSL file,
Xml
The previous article talked about how XSL and XML are browsed on the client side. It is also a form of content publishing for CMS content management systems, i.e. XSL (template) +xml (content).
But the reality is not supported by the client
dom| data Java extracts data from any JDBC-compliant database, converts the data into a DOM object, and then formats the data into the desired form using XSL. In the previous article, we demonstrated how to programmatically extract data from a
Style sheet Depth xsl (5)
---Union style sheet
Translation: Sun Yizhong
XSL provides two mechanisms for federated style sheets:
1. style sheet import, allowing the style sheet to be referenced to each other
2. Style sheet contains, allows the
IntroductionSometimes we want to see the system generated XML files (such as the XML format of the project file), if the file structure is simple, our browser seems to be more convenient, but as the XML Schema complex becomes a headache, write a
A small program that used python to process XML Conversion the other day to convert XML and XSL to HTML.
Libxml2 is used. Therefore, libxml2 must be installed first.
#-*-Coding: MBCS -*-#! /Usr/bin/Python
Import libxml2, libxslt
Class
Prerequisites: Install libxml2 libxstl
Http://xmlsoft.org/XSLT/index.html
Installation Package download: http://xmlsoft.org/sources/
Download the exe Installation File on windows:
Http://xmlsoft.org/sources/win32/python/Here is the reprinted test
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.