xslt 1.0 中是否有任何方法将“/”分隔的字符串转换为逗号分隔并用双引号引起来。
输入:
<?xml version="1.0" encoding="UTF-8" ?>
<process xmlns="http://xmlns.oracle.com/Application1/Project1/BPELProcess1">
<input>input1/input2/input3/input4</input>
</process>
输出:
<?xml version = '1.0' encoding = 'UTF-8'?>
<ns0:processResponse xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns0="http://xmlns.oracle.com/Application1/Project1/BPELProcess1">
<ns0:result>"input1","input2","input3","input4"</ns0:result>
</ns0:processResponse>
试试这样:
如果您的处理器支持 EXSLT str:tokenize 或 str:split 扩展函数,则可能会更简单。
请注意,这不会转义现有引号,就像您对 CSV 所期望的那样。