XML data A most common problem is that the data is case, and it is often produced in a headache when data conversion is performed. Below is a solution.
Suppose you have some data to be sent to another system, which also identifies the data of the XML format, and requires all uppercase, the example data is as follows:
Example 1: Person.xml
code:
Suppose you want to convert into the following format:
Example 2: NewPerson.xml
code:
Solving this conversion problem is generally translate () in the XPath function (), for example:
The result of conversion is as follows:
But how do you convert all the text into uppercase? Below is the code for this processing:
Define two variables first:
Conversion again:
The results are as follows:
For the questions just now, you can write the XSL files as follows:
Example 3: Person.xsl
XML Version = "1.0" encoding = "GB2312"?>
Name>
Persons>
xsl: template>
xsl: stylesheet>
Inspire
What will you think of from above? Encrypt data! Yes, use this method to encrypt the XML data.
example:
code:
The result after encryption is as follows:
Decryption is also very simple, just reverse the two variables.
code: