addXSDAsText Method

Description

This method specifies an XML Schema Document to be used with an instance of EditLive! for XML. This method can be called multiple times in order to supply EditLive! for XML with several XSDs. This method accepts an XSD as a text string. Loading XSDs via the addXSDAsText method can reduce the load time of EditLive! for XML. This can be most easily achieved by using server-side scripting to load the XSD file from the server's file system into a scripting string variable which can then be used when instantiating EditLive! for XML.

Note

This property cannot be used with the Visual Designer. To set the XSD for use with the Visual Designer the XSDAsText property must be used.

Syntax

JavaScript

addXSDAsText(strXSD);

Parameters

strXSD

A string which contains a full XSD to be used with this instance of EditLive! for XML.

Note

The XSD string should be URL encoded. This can be achieved with a server side URL encoding method.

Examples

Example 16.5. addXSDAsText Method Example Scripting

The following example adds an XSD for use with EditLive! for XML.

JavaScript

editlivejs.addXSDAsText = "<xsd:schema targetNamespace=...";

Note

The view string parameter for this method must be URL encoded. It is recommended that a server-side URL encoding function be used if available. The usage of the JavaScript escape function is not recommended as the JavaScript escape function does not fully comply with the URL encoding standard.

Note

The XSD in the examples above is incomplete, and will not function. It is given only as a example to aid understanding. The XSD passed to EditLive! for XML via this method should not contain carriage return or new line characters.

Remarks

Using this method instead of setting the setXSDURL property may result in faster load times for EditLive! for XML.

The string parameter for this method must be URL encoded. It is recommended that a server-side URL encoding function be used if available. The usage of the JavaScript escape function is not recommended as the JavaScript escape function does not fully comply with the URL encoding standard.