In XSLT 2.0, why not fn: decode-for-uri?

I have a URI encoded string in XML, but cannot decode it with xslt.

There is fn: encode-for-uri for string encoding

But do not decode-for-uri for decoding.

  • Is there a function that I missed?
  • If not, why doesn't it exist?
+4
source share
1 answer

Michael Kay answered this question here :

There is no such function.

How interesting, what a precedent?

I think that the only reasons for this are not (a) the lack of a precedent, and (b) the difficulty in detailing its indication: what do you do for the example with percent signs that are not followed by two hexadecimal digits.

(b) it seems simple enough to solve: either they say that the behavior is implementation dependent, or they say that the processor will cause a runtime error. But maybe there is more to this issue than I know.

Update: This subsequent post (in the same thread as above) shows the XSLT implementation of a function for decoding percent encoding (unconditionally).

+2
source

Source: https://habr.com/ru/post/1479957/


All Articles