beautypg.com

File manipulation functions, Dom.cleanupxhtml() – Adobe Dreamweaver API Reference CS5 User Manual

Page 254

background image

249

DREAMWEAVER API REFERENCE

Document

Last updated 8/27/2013

Arguments
commandFile, {commandArg1}, {commandArg2},...{commandArgN}

The commandFile argument is a filename in the Configuration/Commands folder.

The remaining arguments, commandArg1, commandArg2, and so on, which are optional, pass to the

receiveArguments()

function in the commandFile argument.

Returns
Nothing.

Example
You can write a custom Property inspector for tables that lets users get to the Format Table command from a button
on the inspector by calling the following function from the button’s

onClick

event handler:

function callFormatTable(){

dreamweaver.runCommand('Format Table.htm');

}

File manipulation functions

File manipulation functions handle creating, opening, and saving documents (including XML and XHTML),
converting existing HTML documents into XHTML, and exporting CSS to external files. These functions accomplish
such tasks as browsing for files or folders, creating files based on templates, closing documents, and getting
information about recently opened files.

dom.cleanupXHTML()

Availability
Dreamweaver MX.

Description
This function is similar to the

convertToXHTML()

function, but it cleans up an existing XHTML document. This

function can run on a selection within the document. You can run the

cleanupXHTML()

function to clean up the

syntax in an entire XHTML document or in the current selection of a document.

Arguments
bWholeDoc

The bWholeDoc argument holds a Boolean value. If the value is

true

, the

cleanupXHTML()

function cleans up the

entire document; otherwise, this function cleans up only the selection.

Returns
An array of six integers that quantify the number of the following elements:

XHTML errors that Dreamweaver fixed

The

map

elements that do not have an

id

attribute and cannot be fixed

The

script

elements that do not have a

type

attribute and cannot be fixed