IsValidString (XmlDoc function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<span style="font-size:120%; color:black"><b>Valid XML Element/Attribute value?</b></span> | <span style="font-size:120%; color:black"><b>Valid XML Element/Attribute value?</b></span> | ||
<!--DPL?? Category:XmlDoc methods|IsValidString obsolete shared function: Valid XML Element/Attribute value?--> | <!--DPL?? Category:XmlDoc methods|IsValidString obsolete shared function: Valid XML Element/Attribute value?--> | ||
<!--DPL?? Category:XmlDoc API methods|IsValidString (obsolete shared XmlDoc function): Valid XML Element/Attribute value?--> | <!--DPL?? Category:XmlDoc API methods|IsValidString (obsolete shared XmlDoc function): Valid XML Element/Attribute value?--> | ||
<!--DPL?? Category:System methods|IsValidString (obsolete shared XmlDoc function): Valid XML Element/Attribute value?--> | <!--DPL?? Category:System methods|IsValidString (obsolete shared XmlDoc function): Valid XML Element/Attribute value?--> | ||
<p> | <p> | ||
IsValidString is a member of the [[XmlDoc class]]. | <var>IsValidString</var> is a member of the [[XmlDoc class]]. | ||
</p> | </p> | ||
This shared function determines whether a string value | This shared function determines whether a string value | ||
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 <var>XmlDoc</var>, this function was new | ||
as of version 6.8 of | as of version 6.8 of <var class="product">Sirius Mods</var> and <b><i>deprecated in favor of <var>[[InvalidCharacterPosition (XmlDoc function)|InvalidCharacterPosition]]</var></i></b> in version 7.0. | ||
=== | |||
==Syntax== | |||
<p class="syntax"><span class="term">%bool</span> = <span class="literal">%(XmlDoc)</span>:<span class="literal">IsValidString</span>(<span class="term">value</span>)</p> | |||
< | |||
< | ===Syntax Terms=== | ||
< | <table> | ||
(< | <tr><th>%bool</th> | ||
For more information about enumerations, see [[Enumerations]]. | <td>A declared enumeration object of type Boolean to contain the returned value | ||
< | (<var>True</var> or <var>False</var>) of <var>IsValidString</var>. | ||
< | For more information about enumerations, see [[Enumerations]].</td></tr> | ||
<tr><th><var class="nobr">%(XmlDoc)</var></th> | |||
<td>The class name in parentheses denotes a shared method; | |||
you may instead provide an XmlDoc object expression (for example, a %variable). | you may instead provide an XmlDoc object expression (for example, a %variable). | ||
For more information about shared methods, see [[??]] refid=shared.. | For more information about shared methods, see [[??]] refid=shared..</td></tr> | ||
< | |||
< | <tr><th>value</th> | ||
As of | <td>The input string whose characters are to be validated. | ||
Formerly, only EBCDIC was allowed. | 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.</td></tr> | |||
</table> | |||
==Usage Notes== | |||
<ul> | <ul> | ||
<li>IsValidString returns < | <li><var>IsValidString</var> returns <var>True</var> if its argument string is: | ||
<ul> | <ul> | ||
<li>Unicode, and all characters are legal in an Element or Attribute value | <li>Unicode, and all characters are legal in an Element or Attribute value | ||
Line 41: | Line 44: | ||
</ul> | </ul> | ||
Otherwise, it returns < | Otherwise, it returns <var>False</var>. | ||
Prior to | Prior to <var class="product">Sirius Mods</var> 7.6, the invalid characters of an Element or Attribute | ||
node were the EBCDIC | node were the EBCDIC "control characters." | ||
<li>If the result of the IsValidString call is < | <li>If the result of the <var>IsValidString</var> call is <var>True</var>: | ||
<ul> | <ul> | ||
<li>The AddAttribute, AddElement, AddText, InsertTextBefore, | <li>The <var>AddAttribute</var>, <var>AddElement</var>, <var>AddText</var>, <var>InsertTextBefore</var>, | ||
and InsertElementBefore functions may use the | and <var>InsertElementBefore</var> functions may use the | ||
''value'' string as their second argument. | ''value'' string as their second argument. | ||
<li>The Value property of an Element, Attribute, or Text node | |||
<li>The <var>Value</var> property of an Element, Attribute, or Text node | |||
may use the ''value'' string as the right | may use the ''value'' string as the right | ||
side of an assignment (subject to restrictions on null strings). | side of an assignment (subject to restrictions on null strings). | ||
</ul> | </ul> | ||
</ul> | </ul> | ||
==Request-Cancellation Errors== | |||
<ul> | <ul> | ||
<li>IsValidString has no request cancellation errors. | <li><var>IsValidString</var> has no request cancellation errors. | ||
</ul> | </ul> | ||
[[Category:XmlDoc methods|IsValidString obsolete shared function]] | |||
[[Category:XmlDoc API methods]] |
Latest revision as of 00:04, 3 September 2014
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.