XSLTools

Change of XSLForms/Output.py

418:bf67c1291e88
XSLForms/Output.py
     1.1 --- a/XSLForms/Output.py	Thu Nov 24 16:53:05 2005 +0000
     1.2 +++ b/XSLForms/Output.py	Fri Nov 25 18:17:15 2005 +0000
     1.3 @@ -326,10 +326,15 @@
     1.4      in the optional 'charset' (UTF-8 if not specified). Note that / and #
     1.5      characters are replaced with their "URL encoded" character values.
     1.6  
     1.7 +    If a string value is supplied for 'nodes', this will be translated instead.
     1.8 +
     1.9      template:url-encode(./text(), 'iso-8859-1')
    1.10      """
    1.11  
    1.12      l = []
    1.13 +    if isinstance(nodes, str):
    1.14 +        return urllib.quote(nodes.encode("utf-8")).replace("/", "%2F").replace("#", "%23")
    1.15 +
    1.16      for node in nodes:
    1.17          s = libxml2dom.Node(node).nodeValue
    1.18          l.append(urllib.quote(s.encode("utf-8")).replace("/", "%2F").replace("#", "%23"))