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.html "target =" _ blank "> xslt to convert it to html, I did not expect to spend a lot of time. Now I will record the results of my normal work and hope to help you.
Let's first look at my xml file. The menu to be used to define the webpage.
A simple xml file is used to automatically Generate a Schema file using the Generate schema function of xmlspy, and then make some minor modifications. The result is as follows:
Specifically, the xsd is specified using the Assign Schema function of xmlspy in xml. the root node menu_items in xml is:
Next, create an xslt file and only give the correct results:
>
What is annoying is that,
xpath-default-namespace="http://www.hz-sp.com/2005/XMLSchema-menu"
There is no effect on the match of xsl: template. it is estimated that the match is not xpath. However, this attribute does not work for select in for-each, which is strange. it is estimated that I have not understood how to use this attribute.
The above is a detailed description of the instance code that uses xml, schema, and xslt at the same time. For more information, see other related articles in the first PHP community!