In the recent project development process, the mentor asked me to make an RSS subscription function. After several hard work, I finally got it, however, it is disappointing that when using IE6 for browsing, it is not as shown in IE8, and IE6 contains all XML code. Finally, we finally found the best solution: using XSLT to convert XML into XHTML. Let's see how to escape ....
The content in the XML file is:
Lt; RSS version = "2.0" gt;
Add this sent
Using PHP+XSLT on the Windows platform
1. Download PHP 4.0.6 to Http://www.php.net
2. Unzip the Php-4.0.6-win32.zip to the c:php
3. Configure PHP on the Web server
3. Copy the following four files under the DLLs directory to Windowssystem (32)
Expat.dll
Sablot.dll
Xmlparser.dll
Xmltok.dll
4. Modify PHP.ini
Modify Extension_dir point to the correct extension directory
Extension_dir = C:/php/extensions
and find the following line.
; Extension=php_sablot
Using PHP+XSLT on the Windows platform
1. Download PHP 4.0.6 to Http://www.php.net
2. Unzip the Php-4.0.6-win32.zip to the c:\php
3. Configure PHP on the Web server
3. Copy the following four files under the DLLs directory to Windows\System (32)
Expat.dll
Sablot.dll
Xmlparser.dll
Xmltok.dll
4. Modify PHP.ini
Modify Extension_dir point to the correct extension directory
Extension_dir = C:/php/extensions
and find the following line.
; Extensio
XML on the network can often see the background color by row alternately set table, more beautiful. But not necessarily what advanced Server technology, with simple xsl+xml still can be very good to achieve them.
For example, we have an XML document that records the URL:
Now, I would like to classify him as a table with two colors alternating in rows. As shown in the following illustration:
XSL can write this,
Xmlns:xsl= "Http://www.w3.org/1999/XSL/Transform" >
Common operators in XSLT programming are as follows:
! = Not equal"" (Literal) Text''(Literal) Text() (Grouping) Group* (All nodes) All nodes* (Multiplication) wildcard+ Add-Subtraction-(Unary minus). (Self axis short form) Current element... (Parent axis short form) parent Element/(Step separator) Select child element// (Descendant-or-self axis short form) Select the child element, no matter how deep: (Axis specifier) (I don't know how to translate i
elements. Each XML file must have only one element. Elements can be divided into simple elements and composite elements (with lower-level elements ).(3) attributes can be included in an element (attributes)
4. What is a Cascading Style Sheet?The description structure of the common flag language, rather than the format. The style sheet adds the display format without damaging the document structure.
5. What is XSL? What is the relationship with CSS? What is the relationship with
I mentioned some basic XSLT conversion XML knowledge in my previous article. Here I will give a systematic summary. The purpose of learning is to be practical.
Let's talk about the project requirements.Project requirements: 1) The display mode of the page changes frequently, but the data is relatively small. 2) The page displays different places and displays different results. But the data remains unchanged. 3) It is difficult to select data on the p
After reading w3school documents, you can see that XSLT provides two system functions to convert string case formats: upper-case () and lower-case (). However, these two functions are for analyticdb 1.0 and later versions. Microsoft uses XSLT, so when youCodeWhen these two functions are used, the system prompts that they are invalid. Here is an alternative solution, which can be solved by using the translat
:
In the enterprise EP development process, the use of RSS is very common.
In the above example, two webparts are used in Moss (content editing webpart + RSS webpart)
We will not introduce the content editing webpart. Very easy
For RSS webpart, you only need to configure RSS link on the toolbar panel.
For example, http: // 10.5.16.16/ACD/EFG/abcdeff/rss_ldjh.jsp is a standard RSS source.
The RSS style is as follows:
A certain degree of XSL is required.
Version = "1.0" exclude-result-prefixes =
Use php + xslt on windows. Use php + iist1 on windows. Download php4.0.62 from www.php.net. Decompress php-4.0.6-win32.zip to c: php 3. Configure php3 on webserver. Copy the following in the dlls directory and use php + xslt on windows.
1. Download php 4.0.6 to http://www.php.net
2. Decompress php-4.0.6-win32.zip to c: \ php.
3. Configure php on web server
3. Copy the following four files in the dlls di
The copy and copy-of structures are used to copy nodes. The copy element only copies the current node without any nodes or attributes. But copy-of is all copied.
XSLT stylesheet 1
XML source codeOutputCompare Compare these constructs.View in HTMLCopy-:CompareThese constructs.Copy:Value-:Compare these constructs.
XSLT stylesheet Xmlns: XSL = 'HTTP: // www.w3.org/5o/#/transform'> Div > B >
The following XSLT style TABLE statement is incorrect.
XSL: Variable
Name
= "Formatinfo"
Select
= "'Datetime '"
/>
XSL: Call-template
Name
= "$ Formatinfo"
/>
This is because the XSLT call-template Template Name cannot be a variable, it is a QNAME, not an expression or attribute value template.
However, it is said that Saxon supports specifying the Template Name At
XSLT/XML/C # (for conversion) This routine shows how to apply xslt to xml format data read from the database. The routine is fully written in C:Using System;Using System. Collections;Using System. Data;Using System. Data. SqlClient;Using System. Xml;Using System. Xml. Xsl;Public class implements ttransform{Public static void Transform (){SqlConnection nwindConn = new SqlConnection ("DataSource = INMUMI
" select node conversion (similar to the foreach statement in programming languages ),In the following example, child elements under pets are selected and the names of child elements are displayed cyclically:Copy codeThe Code is as follows:
3) xsl: if element condition display nodes (similar to the if statement in programming languages) should be replaced by Copy codeThe Code is as follows:
4) xsl: multi-branch condition display of choose (similar to the switch statement in programming languag
The product used ASP a few years ago, and then upgraded to. Net 1.1, and then to 2.0, it has always been useful for XSLT to transform XML to generate Web pages in a slightly sorted way.
XML file:
? XML version= "1.0" encoding= "Utf-8"?>
? XML version= "1.0" encoding= "Utf-8"?>
xmlns:xsl = "Http://www.w3.org/1999/XSL/Transform" >
Converted HTML view
Book
Name
Author
Price
Inside SQL Server 2000
Kalen Delaney
XSLT can be converted to an XML data file (TRANSFOM), which acts as a style sheet (CSS) to an HTML file.
This article assumes that we have an XML data file
Also, let's assume that there is a well-written XSLT file
Variables are one of the most common objects that we have encountered while programming. It provides a mechanism for storing data and reusing code in code. Is there a way to use variables in XSLT?
The answer is yes.
First look at how to use variable-code
By this definition we declare a variable called header, which represents the header of a table. Suppose you have multiple tables in your XSL
Factory class: Obtained by abstract class javax.xml.transform.TransformerFactory.newInstance () to Implement factory class
The search path order for this factory method is as follows:
1. Check the Java System property value "Javax.xml.transform.TransformerFactory"
2. Querying the contents of the/meta-inf/services/javax.xml.transform.transformerfactory file in the jar file
Several commonly used classes:
Techcommon:
Depending on the system properties of Java,
Javax.xml.transform.transformer
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.