TQS Home
Trivia Quiz Shell Version 2.8 Now Available!Bot Productions Home
 
TQS 2.5

Back to Reference

xmlSetText Function

Sets the text contents of an XML element.

Syntax
xmlSetText(el, val);
Parameters

el
XML element object whose contents are to be set.
val
The value to which the contents should be set.
Returns

There is no return value.

Remarks

Use this function to manipulate your custom data, for instance to keep track of the status of questions as you present them.

Using this function instead of the text property of XML element objects protects you from scripting errors if the element does not exist.

Example

<CUSTOM_FOO>
  <FOOQUESTION>
    <STATUS/>
  </FOOQUESTION>
  <FOOQUESTION>
    <STATUS/>
  </FOOQUESTION>
  ...
</CUSTOM_FOO>
xmlSetText(xmlChildOf(xmlChildOf(xmlLocData,
  "FOOQUESTION", 0), "STATUS", 0), "CORRECT");
xmlSetText(xmlChildOf(xmlChildOf(xmlLocData,
  "FOOQUESTION", 0), "NOEXIST", 0), "CORRECT");


©2016 Bot Productions. All rights reserved.Last Updated: June 14, 2001