Converting XML to escaped text in XSLT

前端 未结 8 1684
挽巷
挽巷 2020-12-03 02:54

How can I convert the following XML to an escaped text using XSLT?

Source:



  

        
8条回答
  •  猫巷女王i
    2020-12-03 03:45

    Do you need to use XSLT? Because, for reasons explained by Pavel Minaev, it would be much simpler to use another tool. An example with xmlstartlet:

    % xmlstarlet escape
    
    
      
        mnop
      
    
    [Control-D]
    <?xml version="1.0" encoding="utf-8"?>
    <abc>
      <def ghi="jkl">
        mnop
      </def>
    </abc>
    

提交回复
热议问题