SetXMLNodeValue Function

Description

This function is for use in conjunction with an ephox:button element embedded in a form for EditLive! for XML that uses the getCurrentNodeValue action. This function will allow the developer to set the value of an XML node given the ID of that node as supplied by the ephox:button using the getCurrentNodeValue action.

Syntax

JavaScript

SetProperties(intID, strValue);

Parameters

intID

An integer specifying the ID of the relevant XML node.

strValue

A string containing the value to set for the XML node.

Note

This string must be URL encoded. It is recommended that this encoding is done via a server-side URL encoding method. Encoding can be achieved using the JavaScript escape function, however, this is not recommended as the escape function does not fully comply with the URL encoding standards.

Example

Example 17.11. SetProperties Runtime Function Example

The following sets the properties for an instance of a tag inside an instance of EditLive! for XML named editlivejs.

//set up an instance of EditLive!
var editlivejs;
editlivejs = new EditLiveXML("editlive",700,400);
editlivejs.setDownloadDirectory("editlivexml");
editlivejs.setLocalDeployment(false);
editlivejs.setConfigurationFile("sample_config.xml");
...
editlivejs.show();
...
//create a function which sets properties
function setNewNodeValue(nodeID,newValue){
  editlivejs.SetXMLNodeValue(nodeID, newValue);
}

Remarks

In order to correctly set the properties of the relevant node it should be ensured that the id value supplied by the getCurrentNodeValue action is not altered by the functions external to EditLive! for XML.