# CKEditor 3.0 JavaScript API Documentation

Code Index | File Index

## Namespaces

- CKEDITOR
- CKEDITOR.ajax
- CKEDITOR.config
- CKEDITOR.dom
- CKEDITOR.dtd
- CKEDITOR.env
- CKEDITOR.imageCacher
- CKEDITOR.loader
- CKEDITOR.plugins
- CKEDITOR.resourceManager
- CKEDITOR.scriptLoader
- CKEDITOR.skins
- CKEDITOR.test
- CKEDITOR.themes
- CKEDITOR.tools

## Classes

- CKEDITOR.commandDefinition
- CKEDITOR.dialog
- CKEDITOR.dialog.buttonDefinition
- CKEDITOR.dialog.contentDefinition
- CKEDITOR.dialog.contentDefinitionObject
- CKEDITOR.dialog.dialogDefinition
- CKEDITOR.dialog.dialogDefinitionObject
- CKEDITOR.dialog.uiElementDefinition
- CKEDITOR.dialogCommand
- CKEDITOR.dom.document
- CKEDITOR.dom.domObject
- CKEDITOR.dom.element
- CKEDITOR.dom.event
- CKEDITOR.dom.node
- CKEDITOR.dom.selection
- CKEDITOR.dom.text
- CKEDITOR.dom.window
- CKEDITOR.editor
- CKEDITOR.event
- CKEDITOR.eventInfo
- CKEDITOR.focusManager
- CKEDITOR.htmlParser
- CKEDITOR.htmlParser.cdata
- CKEDITOR.htmlParser.comment
- CKEDITOR.htmlParser.element
- CKEDITOR.htmlParser.fragment
- CKEDITOR.htmlParser.text
- CKEDITOR.htmlWriter
- CKEDITOR.keystrokeHandler
- CKEDITOR.pluginDefinition
- CKEDITOR.ui
- CKEDITOR.ui.button
- CKEDITOR.ui.dialog.button
- CKEDITOR.ui.dialog.checkbox
- CKEDITOR.ui.dialog.file
- CKEDITOR.ui.dialog.fileButton
- CKEDITOR.ui.dialog.hbox
- CKEDITOR.ui.dialog.html
- CKEDITOR.ui.dialog.labeledElement
- CKEDITOR.ui.dialog.radio
- CKEDITOR.ui.dialog.select
- CKEDITOR.ui.dialog.textarea
- CKEDITOR.ui.dialog.textInput
- CKEDITOR.ui.dialog.uiElement
- CKEDITOR.ui.dialog.vbox
- CKEDITOR.ui.handlerDefinition
- CKEDITOR.xml

# Class CKEDITOR.xml

Defined in: core/xml.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
--- | ---
| baseXml 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-2009, CKSource - Frederico Knabben. All rights reserved.