How to transform a String containing XML tags into a XML document

前端 未结 1 748
无人及你
无人及你 2021-01-29 02:25

I have a String containing the following:

\"

        
相关标签:
1条回答
  • 2021-01-29 02:50

    Assuming you are passing the string to the XSLT stylesheet as a parameter, and processing a dummy XML document, you have two options:

    1. Output the string with output escaping disabled, save the result as a new document, then process the new document with another XSLT stylesheet;

    2. Use XSLT 3.0 (or a processor that supports parsing XML as an extension) to parse the string as XML before processing it.

    Of course, you could save yourself all this trouble by writing the string to a file using your parent process, then pointing your XSLT processor to the resulting file.

    0 讨论(0)
提交回复
热议问题