Difference between revisions of "Function xml.check()"

From wiki.netio-products.com
Jump to navigation Jump to search
(Založena nová stránka s textem „{{DISPLAYTITLE:function xml.check()}} Tests if string is well-formed XML. <i>boolean</i> <b>xml.check</b>(<code>xmlstring</code>) === Parameters === * <i…“)
 
 
Line 1: Line 1:
 
{{DISPLAYTITLE:function xml.check()}}
 
{{DISPLAYTITLE:function xml.check()}}
 
Tests if string is well-formed XML.
 
Tests if string is well-formed XML.
  <i>boolean</i> <b>xml.check</b>(<code>xmlstring</code>)
+
  <i>boolean</i> <b>xml.check</b>(<i>string</i> <code>xml</code>)
  
 
=== Parameters ===
 
=== Parameters ===
* <i>string</i> <code>xmlstring</code> string to escape
+
* <i>string</i> <code>xml</code> string to escape
  
 
=== Return value ===
 
=== Return value ===

Latest revision as of 18:17, 5 May 2017

Tests if string is well-formed XML.

boolean xml.check(string xml)

Parameters

  • string xml string to escape

Return value

boolean
  • true if xmlstring is well-formed xml
  • false if not

Usage

local badnode = "<note>".."3<5".."</note>" local goodnode = "<note>"..xml.escape("3<5").."</note>" log(tostring(xml.check(badnode))) -- false log(tostring(xml.check(goodnode))) -- true

See also