I have never used schema before. I hope to add namespace and schema to my xml file this time, and then convert it into html using xslt. I didn't expect to spend a lot of time. Now I will record the results of my normal work and hope to help you. I have never used schema before. I hope to add namespace and schema to my xml file this time, and then use # wiki/1529.
I've never used a schema before, this time I wanted to add namespace to my XML file, schema, and then transform it into HTML with XSLT, but I didn't think it would take much effort. Now I have a good record of the results of the work, I hope to help some people.
Let's take a look at my XML file first. The menu that you intend to use to define the page.
Ve
$db; Use just the $db object
Include_once ("xml/sql2xml.php"); To include Sql2xml in.
$sql 2xmlclass = new Xml_sql2xml ($DB); Instantiate the Sql2xml
$sql 2xmlclass->setencoding ("GB2312"); Set the type of transcoding for data
if (false = = $xmlstring) {//If the user passes in the array data, the array data is applied to the XSL
Set the node name for generating XML document data
$options = Array (tagnamero
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"?>
?
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
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
I've never used a schema before, this time I wanted to add namespace to my XML file, schema, and then transform it into HTML with XSLT, but I didn't think it would take much effort. Now I have a good record of the results of the work, I hope to help some people.
Let's take a look at my XML file first. The menu that you intend to use to define the page.
Very simpl
as productid, 10 as quantityUnion allSelect 125, 1 as productid, 100 as quantityUnion allSelect 123,2, 20Union allSelect 124,3, 5),ProductAs(Select 1 as id, N 'leewhoeeuniversity 'as nameUnion allSelect 2, N 'depop')Select * from product, [order] where [order]. productid = product. idOrder by orderid
Result:
Id name orderid productid quantity1 LeeWhoeeUniversity 122 1 102 depaster 123 2 201 LeeWhoeeUniversity 125 1 100
Then perform the XML query of
An XSLT associated with it, word will not apply the XSLT when opening the document.
NoteYou can define a solution to associate XSLT with a specific type of XML document, rather than manually applying XSLT. This association needs to be performed in the "Architecture library"
find a way to completely remove the XSL operation, but I still found a way to block out when I accidentally clicked XML to run directly. the XML file generation method is to create a fake Java XSLT processor:
1. Open eclipse indigo and execute the menu command window | preferences;
2. Find XML | XSL | Java processor
How to Use the SELECT statement for XML in MSSQL 2000 to generate xml files
xmlns:dc="http://purl.org/dc/elements/1.1/"xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">rdf:about="http://www.cnblogs.com/ZhouXiHong/archive/2006/01/11/315045.html"dc:identifier="http://www.cnblogs.com/ZhouXiHong/arch
productid, 10 as quantityUnion allSelect 125, 1 as productid, 100 as quantityUnion allSelect 123,2, 20Union allSelect 124,3, 5),ProductAs(Select 1 as id, N 'leewhoeeuniversity 'as nameUnion allSelect 2, N 'depop')Select * from product, [order] where [order]. productid = product. idOrder by orderid
Result:
Id name orderid productid quantity1 LeeWhoeeUniversity 122 1 102 depaster 123 2 201 LeeWhoeeUniversity 125 1 100
Then perform the XML query of the
SQL statement for generating query results in XML format:
Select ID, username, userpwd from userinfo for XML auto, Elements
The following code shows how to save the query results in XML format to a file named userinfo. XML in vs2005. Of course, we must first create an
Note the point:The 1.MVC controller must inherit from the Apicontroller, otherwise it will not be visible.2. Simple view of XML, according to the second step to generate XML, visual sense is relatively low, but the content is all, not limited to the APIThe following is the reproduced text============================================================================
{Persister.write (B1,NewFile ("B.xml")); Persister.write (B1, System.out); } Catch(Exception e) {//TODO auto-generated Catch blockE.printstacktrace (); } }}The B.xml file is written here, and the console is also written for easy viewing, and the console output is as follows:is not like Hypertext language HTML format ~Run interface, parse function file App.java: PackageCom.newer.xml;ImportJava.io.File;ImportOrg.simpleframework.xml
-each loop starts when the program encounters a tag. This loop ends when the program encounters a tag. Once this loop is run, this template will be applied every time the tag appears.
4. generate html
In the future, the browser will integrate the xml parsing engine. At that time, you can directly send xml and xsl files to the browser, while the browser displays
.
Choose
In this case, the when tag checks the XML for the quantity tag. If the quantity tag contains an error property with the value True, the quantity tag will display the table cell listed below. If the value of the property is not true, the XSL displays the content between the otherwise tags. In the following example, if the error property is not true, nothing is displayed.
For-each
The For-each loop starts when the program encounters a lab
Plsql NOTE--------XML GenerateUsing XML in PL/SQL, Oracle provides several components that make it easy for developers to take advantage of XML technology. These components include:1.XML analysis Program. That is used to parse, construct, and validate XML documents.2.XPath e
Generate php code for the ubuntu automatic switch wallpaper xml file. Copy the code as follows :? Php ** generates ubuntu auto-switch wallpaper xml file * image directory $ dirhomeyuxingbackground; $ hdopendir ($ dir) ordie (cannotopendir); $ fi
The code is as follows:
/** Gen
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.