IsValidString (XmlDoc function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
Line 12: Line 12:
is a valid XML Element or Attribute value.
is a valid XML Element or Attribute value.
Designed to be used prior to updating an XmlDoc, this function was new
Designed to be used prior to updating an XmlDoc, this function was new
as of version 6.8 of ''Sirius Mods'' and deprecated in favor of [[InvalidCharacterPosition (XmlDoc function)|InvalidCharacterPosition]] in version 7.0.
as of version 6.8 of <var class="product">Sirius Mods</var> and deprecated in favor of [[InvalidCharacterPosition (XmlDoc function)|InvalidCharacterPosition]] in version 7.0.
===Syntax===
===Syntax===
   %bool = %(XmlDoc):IsValidString(value)
   %bool = %(XmlDoc):IsValidString(value)
Line 27: Line 27:
<dt><i><b>value</b></i>
<dt><i><b>value</b></i>
<dd>The input string whose characters are to be validated.
<dd>The input string whose characters are to be validated.
As of ''Sirius Mods'' version 7.6, this may be a Unicode string or an EBCDIC string.
As of <var class="product">Sirius Mods</var> version 7.6, this may be a Unicode string or an EBCDIC string.
Formerly, only EBCDIC was allowed.
Formerly, only EBCDIC was allowed.


Line 43: Line 43:
Otherwise, it returns <tt>False</tt>.
Otherwise, it returns <tt>False</tt>.


Prior to ''Sirius Mods'' 7.6, the invalid characters of an Element or Attribute
Prior to <var class="product">Sirius Mods</var> 7.6, the invalid characters of an Element or Attribute
node were the EBCDIC &ldquo;control characters.&rdquo;
node were the EBCDIC &ldquo;control characters.&rdquo;
<li>If the result of the IsValidString call is <tt>True</tt>:
<li>If the result of the IsValidString call is <tt>True</tt>:

Revision as of 20:49, 19 June 2012

Valid XML Element/Attribute value?

IsValidString is a member of the XmlDoc class.

This shared function determines whether a string value is a valid XML Element or Attribute value. Designed to be used prior to updating an XmlDoc, this function was new as of version 6.8 of Sirius Mods and deprecated in favor of InvalidCharacterPosition in version 7.0.

Syntax

  %bool = %(XmlDoc):IsValidString(value)

Syntax Terms

%bool
A declared enumeration object of type Boolean to contain the returned value (True or False) of IsValidString. For more information about enumerations, see Enumerations.
%(XmlDoc)
The class name in parentheses denotes a shared method; you may instead provide an XmlDoc object expression (for example, a %variable). For more information about shared methods, see ?? refid=shared..
value
The input string whose characters are to be validated. As of Sirius Mods version 7.6, this may be a Unicode string or an EBCDIC string. Formerly, only EBCDIC was allowed.

Usage Notes

  • IsValidString returns True if its argument string is:
    • Unicode, and all characters are legal in an Element or Attribute value (that is, it does not contain any null characters).
    • EBCDIC, and all characters are translatable to Unicode characters other than the null character.

    Otherwise, it returns False.

    Prior to Sirius Mods 7.6, the invalid characters of an Element or Attribute node were the EBCDIC “control characters.”

  • If the result of the IsValidString call is True:
    • The AddAttribute, AddElement, AddText, InsertTextBefore, and InsertElementBefore functions may use the value string as their second argument.
    • The Value property of an Element, Attribute, or Text node may use the value string as the right side of an assignment (subject to restrictions on null strings).

Request-Cancellation Errors

  • IsValidString has no request cancellation errors.