XSDAsText Property

Description

This property specifies an XML Schema Document to be used with an instance of EditLive! for XML. This property accepts an XSD as a text string. Loading an XSD as text is the only way an XSD can be loaded into the Visual Designer. 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 the Visual Designer.

Note

This property differs from the addXSDAsText method in that it can only be used with the Visual Designer and can only be called once.

Syntax

JavaScript

setXSDAsText(strXSD);

Parameters

strXSD

A string which contains a full XSD to be used with this instance of the Visual Designer.

Note

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

Examples

Example 16.35. XSDAsText Property Scripting Example

The following example adds an XSD for use with the Visual Designer.

JavaScript

designerjs.setXSDAsText = "escape(<xsd:schema targetNamespace=...");

Note

The XSD in the example above is incomplete, and will not function. It is given only as a example to aid understanding. The XSD string passed to the Visual Designer via this property should not contain carriage return or new line characters.

Remarks

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.