Home | Top | Free Ajax Editor | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.


createEntityReference Method

Creates a new EntityReference object.

[Script]

Script Syntax

var objXMLDOMEntityReference = oXMLDOMDocument.createEntityReference( name );

Parameters

name A string specifying the name of the entity referenced. This name is subsequently available as the new object's nodeName property.

Return Value

An object. Returns the new IXMLDOMEntityReference object.

Example

The following script example creates a new IXMLDOMEntityReference object and appends it to an IXMLDOMNode object.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var root;
var MyEntity;
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode <> 0)
{    var myErr = xmlDoc.parseError;    
alert("You have error " + myErr.reason); }
else {    root = xmlDoc.documentElement;
   MyEntity = xmlDoc.createEntityReference("newRef");
   root.childNodes.item(0).appendChild(MyEntity);   
 alert(root.xml); }
Home | Top | Free Ajax Editor | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.