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

Back to Reference

xmlSetAttr Function

Sets the value of an XML element's attribute.

Syntax
xmlSetAttr(el, attr, val);
Parameters

el
XML element object which contains the attribute.
attr
The name of the attribute.
val
The value to which the attribute 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.

Example

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

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