Adobe InDesign CS4 (6.0) Object Model JS: XMLElements

InDesign CS4

Class

XMLElements

 A collection of XML elements.

QuickLinks

[], add, anyItem, count, everyItem, firstItem, item, itemByID, itemByName, itemByRange, lastItem, middleItem, nextItem, previousItem, toSource

Properties

PropertyTypeAccessDescription
lengthnumber readonlyThe number of objects in the collection.

Methods

Instances

XMLElement [] (index: number)
Returns the XMLElement with the specified index.

ParameterTypeDescription
indexnumberThe index.

XMLElement add (markupTag: any[, xmlContent: any][, withProperties: Object])
Creates a new XML element.

ParameterTypeDescription
markupTagString
XMLTag
The XML tag used to identify the element. Can accept: String or XMLTag.
xmlContentCell
Graphic
Movie
PageItem
Sound
Story
Table
Text
The content to be marked up. Can accept: Text, Story, PageItem, Movie, Sound, Graphic, Table or Cell. (Optional)
withPropertiesObjectInitial values for properties of the new XMLElement (Optional)

XMLElement anyItem ()
Returns any XMLElement in the collection.

number count ()
Displays the number of elements in the XMLElement.

Array of XMLElement everyItem ()
Returns every XMLElement in the collection.

XMLElement firstItem ()
Returns the first XMLElement in the collection.

XMLElement item (index: any)
Returns the XMLElement with the specified index or name.

ParameterTypeDescription
indexLong Integer
String
The index or name. Can accept: Long Integer or String.

XMLElement itemByID (id: number)
Returns the XMLElement with the specified ID.

ParameterTypeDescription
idnumberThe ID.

XMLElement itemByName (name: string)
Returns the XMLElement with the specified name.

ParameterTypeDescription
namestringThe name.

Array of XMLElement itemByRange (from: any, to: any)
Returns the XMLElements within the specified range.

ParameterTypeDescription
fromLong Integer
String
XMLElement
The XMLElement, index, or name at the beginning of the range. Can accept: XMLElement, Long Integer or String.
toLong Integer
String
XMLElement
The XMLElement, index, or name at the end of the range. Can accept: XMLElement, Long Integer or String.

XMLElement lastItem ()
Returns the last XMLElement in the collection.

XMLElement middleItem ()
Returns the middle XMLElement in the collection.

XMLElement nextItem (obj: XMLElement)
Returns the XMLElement whose index follows the specified XMLElement in the collection.

ParameterTypeDescription
objXMLElementThe XMLElement whose index comes before the desired XMLElement.

XMLElement previousItem (obj: XMLElement)
Returns the XMLElement with the index previous to the specified index.

ParameterTypeDescription
objXMLElementThe index of the XMLElement that follows the desired XMLElement.

string toSource ()
Generates a string which, if executed, will return the XMLElement.

Element of

Document.xmlElements

XMLElement.xmlElements

XMLItem.xmlElements

Used in:

Asset Library.store (using: Array of any[, withProperties: Object])

Jongware, 20-Jun-2010 v3.0.3dContents :: Index