Content Management System
last articleTalked 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 browser, this will also give the server a certain amount of load, the best way to reduce the server service load is to fully implement the static content access mechanism, of course, this requires the XSL and XML to generate HTML or shtml.
This is the second form of HTML or shtml that is called CMS Content Management system content publishing.
There are many ways to implement in Java, first of all, to produce XSL files, that is, template files.
Of course we first want to unify the coding, all the file code is "UTF-8", conforms to the globalization standard. The resulting file encoding format is "UTF-8", the database encoding format is "UTF-8", the automatically generated XSL file, XML file, HTML file, shtml file format must be "UTF-8", of course, also include the declaration inside the file must also be "UTF-8", Of course, please do not confuse the file encoding format and file internal declarations, I think beginners are the easiest to confuse. The file encoding format is the property of the file, the file itself is generated by what encoding format, and the file internal declaration refers to the file content also need to develop coding.
The purpose of course is very simple and clear, to prevent the emergence of everyone's headache garbled ~
Next, we'll talk about two scenarios for CMS Content Management systems: Xsl+xml and HTML (i), which illustrate the Java implementation of XSL template files.
XSL file: test.xsl
<?xml version= "1.0" encoding= "UTF-8"?
<xsl:stylesheet xmlns:xsl= "Http://www.w3.org/1999/XSL/Transform" version= "1.0"
<xsl:output method= "html"/>
<xsl:template match= "/article"
<table cellspacing= "1" cellpadding= "1" width= "border=" 1 ""
<tbody>
<tr>
<td> <xsl:value-of select= "title"/> </td>
<td> <xsl:value-of select= "click"/> </td>
</tr>
<tr>
<td> <xsl:value-of select= "date"/> </td>
<td> <xsl:value-of select= "Author"/> </td>
</tr>
<tr>
<td> <xsl:value-of select= "content" disable-output-escaping= "yes"/> </td>
<td> Test by Glandjacky </td>
</tr>
</tbody>
</table>
</xsl:template>
</xsl:stylesheet>
First you must obtain a string xslcontent that you want to convert to XSL code
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.