[英]dp:serialize and escaping on ibm datapower
I have a project where I need to binary-64-encode an xml-file and put it into another xml. 我有一个项目,我需要二进制64编码一个xml文件并将其放入另一个xml。 To get this to work I first serialize the xml with
dp:serialize
and then use dp:binary-encode
on the resultning variable from that. 为了实现这一点,我首先使用
dp:serialize
xml,然后对结果变量使用dp:binary-encode
。 This works fine except for that all scandinavian characters are escaped. 除了所有斯堪的纳维亚字符都被转义外,这种方法很好。
åäö
gets to be åäö
åäö
成为åäö
when I decode the result. 当我解码结果。
Any ideas? 有任何想法吗? I've tried with
dp:escaping="minimum"
on the output-tag (Does the xsl:output
tag affect dp:serialize
?) and a number of other options. 我试过输出标签上的
dp:escaping="minimum"
( xsl:output
标签是否影响dp:serialize
?)和其他一些选项。 Through printing the serialized result before binary-64-encoding it I've seen that the escaping is added when dp:serialize
is invoked. 通过在二进制64编码之前打印序列化结果,我看到在调用
dp:serialize
时添加了转义。
Is it possible to serialize without escaping on datapower? 是否有可能在没有逃避数据电源的情况下进行序列化?
I don't think you can serialize without escaping. 我不认为你可以序列化而不逃避。 The DataPower escaping, eg "disable-output-escaping" only affects the OUTPUT context and not the "inline" XML...
DataPower转义,例如“disable-output-escaping”仅影响OUTPUT上下文而不影响“内联”XML ...
I think you must handle it as binary data and get the "untouched" XML file from /object/message/node(). 我认为您必须将其作为二进制数据处理,并从/ object / message / node()获取“未触及”的XML文件。
Since the binary node is not "xml" you can encode it straight off: 由于二进制节点不是“xml”,您可以直接编码:
<xsl:variable name="xmlInBase64" select="dp:binary-encode(/object/message/node())"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.