Encrypting and instigating XML data using XSL
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
Suppose you want to convert into the following format:
Example 2: NewPerson.xml
Solving this conversion problem is generally translate () in the XPath function (), for example:
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"?>
What will you think of from above? Encrypt data! Yes, use this method to encrypt the XML data.
Examples:
The result after encryption is as follows:
Decryption is also very simple, just reverse the two variables.