luci-base(-libs): move pcdata() and striptags() from util- to xml-class
authorSven Roederer <freifunk@it-solutions.geroedel.de>
Sat, 6 Jul 2019 12:18:15 +0000 (14:18 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sun, 19 Jul 2020 18:14:35 +0000 (20:14 +0200)
To complete the previous commit these functions are defined in the resulting
luci-base package but are also used in the new luci-base-libs package. So
move them into the new xml-module of the new package.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
42 files changed:
docs/api/index.html
docs/api/modules/luci.dispatcher.html
docs/api/modules/luci.http.conditionals.html
docs/api/modules/luci.http.date.html
docs/api/modules/luci.http.html
docs/api/modules/luci.http.mime.html
docs/api/modules/luci.i18n.html
docs/api/modules/luci.ip.cidr.html
docs/api/modules/luci.ip.html
docs/api/modules/luci.json.html
docs/api/modules/luci.jsonc.html
docs/api/modules/luci.jsonc.parser.html
docs/api/modules/luci.model.ipkg.html
docs/api/modules/luci.model.uci.html
docs/api/modules/luci.rpcc.html
docs/api/modules/luci.rpcc.ruci.html
docs/api/modules/luci.sys.html
docs/api/modules/luci.sys.init.html
docs/api/modules/luci.sys.iptparser.html
docs/api/modules/luci.sys.net.html
docs/api/modules/luci.sys.process.html
docs/api/modules/luci.sys.user.html
docs/api/modules/luci.sys.wifi.html
docs/api/modules/luci.util.html
docs/api/modules/luci.xml.html [new file with mode: 0644]
docs/api/modules/nixio.CHANGELOG.html
docs/api/modules/nixio.CryptoHash.html
docs/api/modules/nixio.File.html
docs/api/modules/nixio.README.html
docs/api/modules/nixio.Socket.html
docs/api/modules/nixio.TLSContext.html
docs/api/modules/nixio.TLSSocket.html
docs/api/modules/nixio.UnifiedIO.html
docs/api/modules/nixio.bin.html
docs/api/modules/nixio.bit.html
docs/api/modules/nixio.crypto.html
docs/api/modules/nixio.fs.html
docs/api/modules/nixio.html
libs/luci-lib-base/luasrc/util.lua
libs/luci-lib-base/luasrc/util.luadoc
modules/luci-base/luasrc/xml.lua [new file with mode: 0644]
modules/luci-base/luasrc/xml.luadoc [new file with mode: 0644]

index 5e3f3c211a9a54a79dedb6270f4245c52168bda6..66a27a33bc6bc377bddf9d4ee36c404407753f23 100644 (file)
                <a href="modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="modules/nixio.html">nixio</a>
        </li>
@@ -328,6 +332,11 @@ LuCI system utilities / wifi related functions.</td>
                <td class="summary"></td>
        </tr>
 
+       <tr>
+               <td class="name"><a href="modules/luci.xml.html">luci.xml</a></td>
+               <td class="summary"></td>
+       </tr>
+
        <tr>
                <td class="name"><a href="modules/nixio.html">nixio</a></td>
                <td class="summary">
index ea33a5c706acd27c6d9218959e7f2199506113eb..32cb49573ba597ae0223e72b25d96ef3973fe465 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 8c940bd3f6c0bbefb4c5ce5da1e44073eca5fee8..14ee627f6880b3fbc39615587d24ca4f6616150d 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 1ec5beb8b7e446568628fed15679ff040196ed31..680dd43137d99b5413036dc2a8c3cf365d97b766 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 47317278491ddd2fc95f1ea88db844b68c21c1be..3e8799e744f7ee7f180cea20a38ac6fc23ac5a7a 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 85eaf53ab042928ac32505d68ee9782bffb1d663..756b0727ae64e6c427c7803d96c41e4384c9edc1 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 0f315bebd5a4ab6d8daa893277e99b0bb9440ba5..5ba44b4c015a6125eacc3379d4551a8058563962 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index ae6c61dc5db73cf0ef3e9871a2b9a65b439d3918..cfe1909352386da94fe1c75fd13aa064f69fd9df 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 0599396b6fee71ec0a6d6355b1357e7a2ffd358e..8d503bd655d4b6079fcb2a8cdf9d307a174cf123 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index db2d1da3f46c2d5de6d8ab5c2050b27b716b24e5..5885556d50e72973e28971256ad1b6571ba1555f 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 79deb933d7bfcf03cda400ede667bfb3b2932f28..f6ab990faab8ee7c0db5eeafa29c66835af68e0b 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 709cb9afc56986886072c310519959108aae255e..54e1e487d54ab42049d61b9160f8c1779e934861 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index a0af3187b74210d5b5ca87e86695fe77ac963626..e97097db5172f65f1bfd690e5e420dd197ff7bd5 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index c1eaf5f8137198f52d014b67f029811f9d8f7dc4..84b6ecc1b8bb24a1772573a870c5374ac4a70c29 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 18065788bd342f7845631540c5e263725ee1e1c3..10d628ff4367d8946a7ee008a44bfa5419d785ae 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 7348f1932b0956159ba73e990874de17445f8811..598020df7e4bd02cbbf57d54ffa022f3a31fa9be 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index b86d280fba386d80eb2e321b3cf5933e1d8cae31..f601e17dd35a24829d312a325f4e31f9ca58858f 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index e2c51f9531e49aaf314d12a05e4c68ec7243d9a0..b178cafca36cb7aafa5c2091fe655c73f9abd12d 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 5928281cf48ec5c4dc93469f1eba427daf907335..aa9f7ce1c5be0dd1b353c759c5c9422c94e68efc 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index e7802bb244bcbcd59da63e18cbf2ad76a57f9375..bf1bb54aa639057b71f2f27cd7d7ecf8392f4d1e 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index d3664817cc985b721b204366d52b0298c551ed5b..ec42ecadd96598d8dfe14a19dd7d53452cb0c892 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index b2307ad385eb126f5a25f0895c06f6dbb3d95929..27b13ccbbf629b76d695b24c0320301792f1bb71 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 6c893244c12c21f08d56a91b79461405ed3e02b2..37e7053fd71cb37b4809f2766cc2d8c31a99229e 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index f8baddf41056b3e10fd5445caef3337c139f40fe..1fc2539928fea4428a113a3aa7901503197c8bda 100644 (file)
 
        <li><strong>luci.util</strong></li>
        
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
@@ -342,10 +346,11 @@ value or 0 if the unit is unknown.</td>
        </tr>
 
        <tr>
-       <td class="name" nowrap><a href="#pcdata">pcdata</a>&nbsp;(value)</td>
+       <td class="name" nowrap><a href="luci.xml.html#pcdata">pcdata</a>&nbsp;(value)</td>
        <td class="summary">
  
-Create valid XML PCDATA from given string.</td>
+Create valid XML PCDATA from given string.
+This is a wrapper for <a href="luci.xml.html#pcdata">luci.xml.pcdata()</a>.</td>
        </tr>
 
        <tr>
@@ -409,10 +414,11 @@ Strips unnecessary lua bytecode from given string.</td>
        </tr>
 
        <tr>
-       <td class="name" nowrap><a href="#striptags">striptags</a>&nbsp;(value)</td>
+       <td class="name" nowrap><a href="luci.xml.html#striptags">striptags</a>&nbsp;(value)</td>
        <td class="summary">
  
-Strip HTML tags from given string.</td>
+Strip HTML tags from given string.
+This is a wrapper for <a href="luci.xml.html#striptags">luci.xml.striptags()</a>.</td>
        </tr>
 
        <tr>
@@ -1178,38 +1184,6 @@ Number containing the canonical value
 
 
 
-<dt><a name="pcdata"></a><strong>pcdata</strong>&nbsp;(value)</dt>
-<dd>
-
-Create valid XML PCDATA from given string. 
-
-
-
-<h3>Parameters</h3>
-<ul>
-       
-       <li>
-         value: String value containing the data to escape
-       </li>
-       
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String value containing the escaped data
-
-
-
-</dd>
-
-
-
-
 <dt><a name="perror"></a><strong>perror</strong>&nbsp;(obj)</dt>
 <dd>
 
@@ -1524,38 +1498,6 @@ String value containing the stripped lua byte code
 
 
 
-<dt><a name="striptags"></a><strong>striptags</strong>&nbsp;(value)</dt>
-<dd>
-
-Strip HTML tags from given string. 
-
-
-
-<h3>Parameters</h3>
-<ul>
-       
-       <li>
-         value: String containing the HTML text
-       </li>
-       
-</ul>
-
-
-
-
-
-
-<h3>Return value:</h3>
-String with HTML tags stripped of
-
-
-
-</dd>
-
-
-
-
 <dt><a name="threadlocal"></a><strong>threadlocal</strong>&nbsp;()</dt>
 <dd>
 
diff --git a/docs/api/modules/luci.xml.html b/docs/api/modules/luci.xml.html
new file mode 100644 (file)
index 0000000..63a91e4
--- /dev/null
@@ -0,0 +1,321 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+    <title>Reference</title>
+    <link rel="stylesheet" href="../luadoc.css" type="text/css" />
+       <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
+</head>
+
+<body>
+<div id="container">
+
+<div id="product">
+       <div id="product_logo"></div>
+       <div id="product_name"><big><b></b></big></div>
+       <div id="product_description"></div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+
+
+<h1>LuaDoc</h1>
+<ul>
+       
+       <li><a href="../index.html">Index</a></li>
+       
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+       <li>
+               <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.http.html">luci.http</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.http.date.html">luci.http.date</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.http.mime.html">luci.http.mime</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.i18n.html">luci.i18n</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.ip.html">luci.ip</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.json.html">luci.json</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.jsonc.html">luci.jsonc</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.model.uci.html">luci.model.uci</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.rpcc.html">luci.rpcc</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.sys.html">luci.sys</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.sys.init.html">luci.sys.init</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.sys.net.html">luci.sys.net</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.sys.process.html">luci.sys.process</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.sys.user.html">luci.sys.user</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
+       </li>
+
+       <li>
+               <a href="../modules/luci.util.html">luci.sys.wifi</a>
+       </li>
+
+       <li><strong>luci.xml</strong></li>
+       
+       <li>
+               <a href="../modules/nixio.html">nixio</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.File.html">nixio.File</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.README.html">nixio.README</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.Socket.html">nixio.Socket</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.bin.html">nixio.bin</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.bit.html">nixio.bit</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.crypto.html">nixio.crypto</a>
+       </li>
+
+       <li>
+               <a href="../modules/nixio.fs.html">nixio.fs</a>
+       </li>
+
+</ul>
+
+
+
+<!-- File list -->
+
+
+
+
+
+
+
+</div><!-- id="navigation" -->
+
+<div id="content">
+
+<h1>Class <code>luci.xml</code></h1>
+
+<p></p>
+
+
+
+
+
+
+
+<h2>Functions</h2>
+<table class="function_list">
+
+       <tr>
+       <td class="name" nowrap><a href="#pcdata">pcdata</a>&nbsp;(value)</td>
+       <td class="summary">
+Create valid XML PCDATA from given string.</td>
+       </tr>
+
+       <tr>
+       <td class="name" nowrap><a href="#striptags">striptags</a>&nbsp;(value)</td>
+       <td class="summary">
+Strip HTML tags from given string.</td>
+       </tr>
+
+</table>
+
+
+
+
+
+
+<br/>
+<br/>
+
+
+<h2><a name="functions"></a>Functions</h2>
+<dl class="function">
+
+
+
+<dt><a name="pcdata"></a><strong>pcdata</strong>&nbsp;(value)</dt>
+<dd>
+
+Create valid XML PCDATA from given string. 
+
+
+
+<h3>Parameters</h3>
+<ul>
+       
+       <li>
+         value: String value containing the data to escape
+       </li>
+       
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String value containing the escaped data
+
+
+
+</dd>
+
+
+
+
+<dt><a name="striptags"></a><strong>striptags</strong>&nbsp;(value)</dt>
+<dd>
+
+Strip HTML tags from given string. 
+
+
+
+<h3>Parameters</h3>
+<ul>
+       
+       <li>
+         value: String containing the HTML text
+       </li>
+       
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+String with HTML tags stripped of
+
+
+
+</dd>
+
+
+
+</dl>
+
+
+
+
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+       <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->
+</body>
+</html>
index 94b44a5ca6f092894c4297c08bca63dab70ca9d3..0def9a4512ffd0d36e0abe6a7b9b30d072f81c7f 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 7d2f48b1e5ae1d162fb5549e50f6cdc4a593829e..a333c407d55798a416203b754344e3c59605a363 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 7a7500a773586117005760f00c8d16ce63bf3819..b46a317bc1b11d76425edcc91e877c1b188c2beb 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index e140659cc7d3b802dfce47e10aab167c02c2d4fe..b8481ef55a55329f96c67a3d514e3c88108e7d6c 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 185099125d1940080e72b3babe30b82c8fe9d81b..f1d48ef2b6072761d003fa46d0e884681a077d9c 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index c84d318955d02cb60025064c601ef92bbea6252b..247670c56139b87cf73047f730c21f139fe554a9 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 5d6098a9f5fd69b80f530dd4f0cb8150f9a517e7..20cdaa55a196a0943559b3a6d2ff026bd13e7c61 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 6410ffb42edec98c658e13b4ccc99a8f838181b6..8521e3e2afa17739847ea4da0214979d576b01b3 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index c8ef018317e46737dea9ee6cd73c1b5e5c8b2fe2..aeb14eb53e61c46010090e77c2777288b78b96fb 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index 419736363c3bf1bd3f19a95e918f017698be3b5e..d0ce111db29bd93eef4044232640b274b33f7cf5 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index b91fe28c1dec102eb7fb2e0641eb033fa061dc97..498620bcdfccb96f727455335457631b3d707f8f 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index c9d34591c2e0595fad8439b37e08da98e800d3bf..956c0e93a8ed394db82971a8f88f36d2436b6adf 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li>
                <a href="../modules/nixio.html">nixio</a>
        </li>
index bf93619c9106e543c3dcb4f7368454a4a17db825..36895486c78062dff9aa4cd7a7dbb8f595f6c54d 100644 (file)
                <a href="../modules/luci.util.html">luci.util</a>
        </li>
 
+       <li>
+               <a href="../modules/luci.xml.html">luci.xml</a>
+       </li>
+
        <li><strong>nixio</strong></li>
        
        <li>
index a30e8b72f31466d28bec20792c6648c9b6989cb2..38e00ad83bd2d9fdafed77d2eddf7d8bff931476 100644 (file)
@@ -159,8 +159,12 @@ end
 -- String and data manipulation routines
 --
 
+-- compatibility wrapper for xml.pcdata
 function pcdata(value)
-       return value and tparser.pcdata(tostring(value))
+       local xml = require "luci.xml"
+
+       perror("luci.util.pcdata() has been replaced by luci.xml.pcdata() - Please update your code.")
+       return xml.pcdata(value)
 end
 
 function urlencode(value)
@@ -182,8 +186,12 @@ function urldecode(value, decode_plus)
        return nil
 end
 
+-- compatibility wrapper for xml.striptags
 function striptags(value)
-       return value and tparser.striptags(tostring(value))
+       local xml = require "luci.xml"
+
+       perror("luci.util.striptags() has been replaced by luci.xml.striptags() - Please update your code.")
+       return xml.striptags(value)
 end
 
 function shellquote(value)
@@ -343,8 +351,6 @@ function parse_units(ustr)
 end
 
 -- also register functions above in the central string class for convenience
-string.pcdata      = pcdata
-string.striptags   = striptags
 string.split       = split
 string.trim        = trim
 string.cmatch      = cmatch
index 4ec68dd1efc0ed356876d584e8dee1e5e0a67b77..3168d9c22012a3fe19042c2cbcc5a37e13d0c2e2 100644 (file)
@@ -70,10 +70,13 @@ Recursively dumps a table to stdout, useful for testing and debugging.
 ---[[
 Create valid XML PCDATA from given string.
 
+This is just a compatibility wrapper for luci.xml.padata()
+
 @class                         function
 @name                          pcdata
 @param value           String value containing the data to escape
 @return                                String value containing the escaped data
+@see                           luci.xml.pcdata
 ]]
 
 ---[[
@@ -100,10 +103,13 @@ URL-encode given string.
 ---[[
 Strip HTML tags from given string.
 
+This is just a compatibility wrapper for luci.xml.striptags()
+
 @class                         function
 @name                          striptags
 @param value           String containing the HTML text
 @return                                String with HTML tags stripped of
+@see                           luci.xml.striptags
 ]]
 
 ---[[
diff --git a/modules/luci-base/luasrc/xml.lua b/modules/luci-base/luasrc/xml.lua
new file mode 100644 (file)
index 0000000..30b3721
--- /dev/null
@@ -0,0 +1,26 @@
+-- Copyright 2008 Steven Barth <steven@midlink.org>
+-- Licensed to the public under the Apache License 2.0.
+
+local tparser = require "luci.template.parser"
+local string = require "string"
+
+local tostring = tostring
+
+module "luci.xml"
+
+--
+-- String and data manipulation routines
+--
+
+function pcdata(value)
+       return value and tparser.pcdata(tostring(value))
+end
+
+function striptags(value)
+       return value and tparser.striptags(tostring(value))
+end
+
+
+-- also register functions above in the central string class for convenience
+string.pcdata      = pcdata
+string.striptags   = striptags
diff --git a/modules/luci-base/luasrc/xml.luadoc b/modules/luci-base/luasrc/xml.luadoc
new file mode 100644 (file)
index 0000000..58de533
--- /dev/null
@@ -0,0 +1,23 @@
+---[[
+LuCI utility functions.
+]]
+module "luci.xml"
+
+---[[
+Create valid XML PCDATA from given string.
+
+@class                         function
+@name                          pcdata
+@param value           String value containing the data to escape
+@return                                String value containing the escaped data
+]]
+
+---[[
+Strip HTML tags from given string.
+
+@class                         function
+@name                          striptags
+@param value           String containing the HTML text
+@return                                String with HTML tags stripped of
+]]
+