Adobe InDesign CS2 (4.0) Object Model JS: XMLElement

InDesign CS2

Class

XMLElement

 An XML element. Base Class: XMLItem

QuickLinks

duplicate, exportFile, getElements, importXML, markup, move, placeXML, remove, select, store, toSource, toSpecifier, untag, validate

Hierarchy

Document | XMLElement | XMLItem
XMLItem
XMLElement
Cell | Character | DTD | EPS | Image | InsertionPoint | Line | PDF | PICT | PageItem | Paragraph | Story | Table | Text | TextColumn | TextStyleRange | WMF | Word | XMLAttribute | XMLComment | XMLElement | XMLInstruction | XMLItem

Properties

PropertyTypeAccessDescription
cellsCells readonlyA collection of table cells.
charactersCharacters readonlyA collection of characters.
contentsSpecialCharactersString r/wThe contents of the text. Can return: String or SpecialCharacters enumerator.
dtdsDTDs readonlyA collection of DTDs.
epssEPSs readonlyA collection of EPS files.
idnumber readonlyThe unique ID of the XMLElement.
imagesImages readonlyA collection of bitmap images in any bitmap file format (including TIFF, JPEG, or GIF).
indexnumber readonlyThe index of the XMLElement within its containing object.
insertionPointsInsertionPoints readonlyA collection of insertion points.
linesLines readonlyA collection of lines.
markupTagString
XMLTag
r/wThe XML tag applied to the element. Can also accept: String.
pageItemsPageItems readonlyThe page items collection, which can be used to process all page items in a container (such as a document, page, or group), regardless of type.
paragraphsParagraphs readonlyA collection of paragraphs.
parentDocument
XMLElement
XMLItem
readonlyThe parent of the XMLElement (a Document, XMLElement or XMLItem).
parentStoryStory readonlyThe story that contains the text.
pdfsPDFs readonlyA collection of PDF files.
pictsPICTs readonlyA collection of PICT graphics.
propertiesObject r/wA property that allows setting of several properties at the same time.
storiesStories readonlyA collection of stories.
storyOffsetnumber readonlyThe index of the character containing the table (from the beginning of the story).
tablesTables readonlyA collection of tables.
textColumnsTextColumns readonlyA collection of text columns.
textStyleRangesTextStyleRanges readonlyA collection of text style ranges.
textsTexts readonlyA collection of text objects.
wmfsWMFs readonlyA collection of WMF graphics.
wordsWords readonlyA collection of words.
xmlAttributesXMLAttributes readonlyA collection of XML attributes.
xmlCommentsXMLComments readonlyA collection of XML comments.
xmlElementsXMLElements readonlyA collection of XML elements.
xmlInstructionsXMLInstructions readonlyA collection of XML instructions.
xmlItemsXMLItems readonlyA collection of XML items.

Methods

Instances

XMLElement duplicate ()
Duplicates the XMLElement.

void exportFile (format: any, to: File[, showingOptions: bool=false][, using: PDFExportPreset])
Exports the object(s) to a file.

ParameterTypeDescription
formatExportFormat
String
The export format. Can accept: ExportFormat enumerator or String.
toFileThe path of the export file.
showingOptionsboolIf true, prompts the user to select export options. (Optional) (default: false)
usingPDFExportPresetThe export style to use. (Optional)

Array of Object getElements ()
Resolves the object specifier, creating an array of object references.

void importXML (from: File)
Imports an XML file.

ParameterTypeDescription
fromFileThe path to the XML file.

void markup (using: any)
Associates the object with the specified XML element while preserving existing content.

ParameterTypeDescription
usingPageItem
Story
Text
The object to mark up. Can accept: Text, Story or PageItem.

XMLElement move (to: LocationOptions[, reference: any])
Moves the element to the specified location.

ParameterTypeDescription
toLocationOptions:
LocationOptions.BEFORE
LocationOptions.AFTER
LocationOptions.AT_END
LocationOptions.AT_BEGINNING
LocationOptions.UNKNOWN
The location in relation to the reference object or within the containing object.
referenceText
XMLItem
The reference object. Note: Required when the to parameter specifies before or after. . Can accept: XMLItem or Text. (Optional)

void placeXML (using: any)
Places XML content into the story, replacing the existing content.

ParameterTypeDescription
usingPageItem
Story
The story into which to place the XML content. Can accept: Story or PageItem.

void remove ()
Deletes the XMLElement.

void select ([existingSelection: SelectionOptions=SelectionOptions.REPLACE_WITH])
Selects the object.

ParameterTypeDescription
existingSelectionSelectionOptions:
SelectionOptions.ADD_TO
SelectionOptions.REMOVE_FROM
SelectionOptions.REPLACE_WITH
The selection status of the XMLElement in relation to previously selected objects. (Optional) (default: SelectionOptions.REPLACE_WITH)

Asset store (using: Library)
Store a page item in a library

ParameterTypeDescription
usingLibraryThe library in which to store

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

string toSpecifier ()
Retrieves the object specifier.

void untag ()
Untags an element.

Array of ValidationError validate ([maximumErrors: number=250])
Validates the element against a DTD.

ParameterTypeDescription
maximumErrorsnumberThe maximum number of validation errors to generate. (Optional) (default: 250)

Element of

DTD.parent

Story.parent

ValidationError.element

XMLAttribute.parent

XMLComment.parent

XMLElement.parent

XMLInstruction.parent

XMLItem.parent

Used in:

void Button.markup (using: XMLElement)

void Button.placeXML (using: XMLElement)

void Character.markup (using: XMLElement)

void EPS.markup (using: XMLElement)

void EPS.placeXML (using: XMLElement)

void FormField.markup (using: XMLElement)

void FormField.placeXML (using: XMLElement)

void GraphicLine.markup (using: XMLElement)

void GraphicLine.placeXML (using: XMLElement)

void Group.markup (using: XMLElement)

void Group.placeXML (using: XMLElement)

void Image.markup (using: XMLElement)

void Image.placeXML (using: XMLElement)

void InsertionPoint.markup (using: XMLElement)

void Line.markup (using: XMLElement)

void Movie.markup (using: XMLElement)

void Oval.markup (using: XMLElement)

void Oval.placeXML (using: XMLElement)

void PDF.markup (using: XMLElement)

void PDF.placeXML (using: XMLElement)

void PageItem.markup (using: XMLElement)

void PageItem.placeXML (using: XMLElement)

void Paragraph.markup (using: XMLElement)

void Polygon.markup (using: XMLElement)

void Polygon.placeXML (using: XMLElement)

void Rectangle.markup (using: XMLElement)

void Rectangle.placeXML (using: XMLElement)

void Sound.markup (using: XMLElement)

void Story.markup (using: XMLElement)

void Story.placeXML (using: XMLElement)

Table Tables.add ([to: LocationOptions=LocationOptions.UNKNOWN][, reference: any][, withProperties: Object])

void Text.markup (using: XMLElement)

void TextColumn.markup (using: XMLElement)

void TextFrame.markup (using: XMLElement)

void TextFrame.placeXML (using: XMLElement)

void TextStyleRange.markup (using: XMLElement)

void Word.markup (using: XMLElement)

array of XMLElement XMLElements.itemByRange (from: any, to: any)

XMLElement XMLElements.nextItem (obj: XMLElement)

XMLElement XMLElements.previousItem (obj: XMLElement)

Return

XMLElement XMLElement.duplicate ()

XMLElement XMLElement.move (to: LocationOptions[, reference: any])

XMLElement XMLElements.add (markupTag: any[, xmlContent: any][, withProperties: Object])

XMLElement XMLElements.anyItem ()

Array of XMLElement XMLElements.everyItem ()

XMLElement XMLElements.firstItem ()

XMLElement XMLElements.item (index: any)

XMLElement XMLElements.itemByID (id: number)

XMLElement XMLElements.itemByName (name: string)

Array of XMLElement XMLElements.itemByRange (from: any, to: any)

XMLElement XMLElements.lastItem ()

XMLElement XMLElements.middleItem ()

XMLElement XMLElements.nextItem (obj: XMLElement)

XMLElement XMLElements.previousItem (obj: XMLElement)

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