xslt - 在 XSLT 2.0 中,为什么没有 fn :decode-for-uri?

标签 xslt xslt-2.0 urlencode

我有一个 URI 编码的 XML 字符串,但无法使用 xslt 对其进行解码。

有一个fn:encode-for-uri对字符串进行编码

但没有 URI 解码 解码。

  • 有没有我错过的功能?
  • 如果没有,为什么它不存在?
  • 最佳答案

    Michael Kay 回答了这个问题 here :

    No there's no such function.

    As a matter of interest, what's the use case?

    I think the only reasons it's not there are (a) absence of a use case, and (b) difficulty in the detail of specifying it: what do you do for example with percent signs that aren't followed by two hex digits.



    (b) 似乎很容易解决:要么说行为取决于实现,要么说处理器会抛出运行时错误。但也许这个问题比我所知道的更多。

    更新:This follow-up post (在上面链接的同一个线程中)显示了一个函数的 XSLT 实现来解码百分比编码(非保留)字符。

    关于xslt - 在 XSLT 2.0 中,为什么没有 fn :decode-for-uri?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16466799/

    相关文章:

    xslt - 向上一个节点,查看父节点是否等同于 XSLT 中的特定节点

    URL 参数中的 PHP URL GET 参数

    apache - tomcat 或 apache 自动编码重定向 url

    xml - 在标签内调用时 cmn 命名空间不起作用

    xml - 加载样式表时出错 : Parsing an XSLT stylesheet failed

    xml - XSLT默认模板模式?

    php - 如何解码 php 中的 url,其中 url 使用 encodeURIComponent() 编码

    xslt - key 的使用 : Consolidating multiple <ul> with intervening <p> elements

    regex - 检查字符串如何以 XSLT 中的数字计数开头

    xpath - XSLT IF 评估规则