Code Index | File Index

Namespaces

Classes


Class CKEDITOR.xml


Defined in: plugins/xml/plugin.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
CKEDITOR.xml(xmlObjectOrData)
Represents a loaded XML document.
Field Summary
Field Attributes Field Name and Description
 
The native XML (DOM document) used by the class instance.
Method Summary
Method Attributes Method Name and Description
 
getInnerXml(xpath, contextNode)
Gets the string representation of hte inner contents of a XML node, based on a XPath query.
 
selectNodes(xpath, contextNode)
Gets a list node from the XML document, based on a XPath query.
 
selectSingleNode(xpath, contextNode)
Get a single node from the XML document, based on a XPath query.
Class Detail
CKEDITOR.xml(xmlObjectOrData)
Since: 3.0
Represents a loaded XML document.
var xml = new CKEDITOR.xml( '' );
Parameters:
{object|string} xmlObjectOrData
A native XML (DOM document) object or a string containing the XML definition to be loaded.
Field Detail
{object} baseXml
Since: 3.0
The native XML (DOM document) used by the class instance.
Method Detail
{String} getInnerXml(xpath, contextNode)
Since: 3.0
Gets the string representation of hte inner contents of a XML node, based on a XPath query.
// Create the XML instance.
var xml = new CKEDITOR.xml( '' );
// Alert "".
alert( xml.getInnerXml( 'list' ) );
Parameters:
{String} xpath
The XPath query to execute.
{Object} contextNode Optional
The XML DOM node to be used as the context for the XPath query. The document root is used by default.
Returns:
{String} The textual representation of the inner contents of the node or null if the query has no results.

{ArrayLike} selectNodes(xpath, contextNode)
Since: 3.0
Gets a list node from the XML document, based on a XPath query.
// Create the XML instance.
var xml = new CKEDITOR.xml( '' );
// Get the first  node.
var itemNodes = xml.selectSingleNode( 'list/item' );
// Alert "item" twice, one for each .
for ( var i = 0 ; i < itemNodes.length ; i++ )
    alert( itemNodes[i].nodeName );
Parameters:
{String} xpath
The XPath query to execute.
{Object} contextNode Optional
The XML DOM node to be used as the context for the XPath query. The document root is used by default.
Returns:
{ArrayLike} An array containing all matched nodes. The array will be empty if the query has no results.

{Object} selectSingleNode(xpath, contextNode)
Since: 3.0
Get a single node from the XML document, based on a XPath query.
// Create the XML instance.
var xml = new CKEDITOR.xml( '' );
// Get the first  node.
var itemNode = xml.selectSingleNode( 'list/item' );
// Alert "item".
alert( itemNode.nodeName );
Parameters:
{String} xpath
The XPath query to execute.
{Object} contextNode Optional
The XML DOM node to be used as the context for the XPath query. The document root is used by default.
Returns:
{Object} A XML node element or null if the query has no results.

Copyright © 2003-2010, CKSource - Frederico Knabben. All rights reserved.