Often see a user to ask some about PHP and XML, database combination of the use of posts, but also often see some beginners
Mix the PHP code with the HTML code, and then when the error can not find the error, the rush, I will give a big
Home about how to use XML technology to separate the HTML code from the PHP program, of course, there are many kinds of separation technology, such as Pear
's IT templates.
We know that XML + XSLT can be directly output to browsers that support XML, such as IE 5.0 or later. However, we also need to consider that many Browsers Do not directly support XML. In this case, we need to convert to html output to the browser on the server. I am afraid this temporary transition method will be used
You need to reference the following namespaces:UsingSystem. XML; UsingSystem. Xml. XSL; Method implementation:Public Static String Convertxml(XmlDocument Inputxmldocument, String Xsltfilepath , XsltArgumentList Xsltargs) { System.Io.StringWriterSw= New System.Io.StringWriter(); XslCompiledTransformXsltrans= new Xslcompiledtransform Xsltrans. Loadxsltfilepath Xsltrans transform (inputxmldocume
Introduction
This article specifically records the Syntax problems in the conversion process of XSLT style sheets.Incorrect value and attribute inversion
The style sheet has been modified several times, but an error is reported as before. The error message is as follows:
[XML task] error: An error occurred with the following error message: "attribute and namespace nodes cannot be added to the parent element
When working with an XML file, you may experience a situation where the file contains sensitive data, and your favorite XML processing tool has a problem, such as a bug. You need to provide the vendor with a sample file that causes a bug. Of course, you can't send an XML file randomly because it may be a special tag in the sample file that is causing the problem.
When using the default namespace in XML, you need to change the namespace when using XSLT for conversion, that is, to name the original default namespace. After one night, I found out that this was the case.
For details about the problem and solution, refer to the following:
Http://bbs.w3china.org/dispbbs.asp? Boardid = 8 id = 50281
In addition, the XML names
Summary
Struts is an excellent framework for Java Web development. Struts is one of the Apache projects and now struts has been widely supported in the Java development community. In this article, Julien Mercay and Gilbert Bouzeid will introduce the process of struts, describe the struts framework, and finally put forward the design method of model 2x. Model 2x replaces the JSP page in the original presentation layer with XML/
Preface
As earlyWebBefore the standardization trend came, I consideredXML + XSLTI think this is a very elegant, efficient, and low coupling solution that will surely become popular.
However, there are still a few people who use this solution to build websites.WebStandardization is not easy.WebStandardization only showsCss) Separated, and the data and structure are still mixed, it is definitely not our final destination, it is just a transitional product.
XHtmlThe original intention of setting up
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"
Php, XML, XSLT, Mysql, and code .? Php (as the mainstream development language) require_onceDB.php (as the mainstream development language); database processing class dataTypeMySQL in PEAR (the best combination with PHP)
Require_once "DB. php (as the mainstream development language)"; // database processing class in PEAR
$ DataType = "MySQL (the best combination with PHP)"; // Database type
$ User = "root";
Frog recommendation: Use the XSLT style sheet on the client to convert XML documents
I have not provided the source XML document and the two XSLT style sheets. You can write them yourself.
View Details nbsp; Nbsp; or nbsp;
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 unchange
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.
point on, the process is the same as external TABLE conversion. The last step is to add fields in each file. This time I didn't create any more embedded tables, but added these fields to the current TD.
Once I complete the general layout, I can start to add the user interface function, such as hiding other folders and file lines until the user clicks the relevant tab. This function can be implemented by writing scripts that support this function, adding an onclick xsl: attribute element to the
How does. Net (C #) generate xml?
XML generated by. Net: menu. xml
XSLT: sitemenu. XSL
Xmlns: XSL = "http://www.w3.org/1999/XSL/Transform">
After generation, parse through JS:
Loadxml ("menu. XML," sitemenu. XSL ");Function loadxml (xmlf, x
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
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.