An XML element.
Go to Property Listing | Method Listing
store, move, duplicate, markup, placeXML, untag, validate, applyParagraphStyle, applyCharacterStyle, convertToAttribute, convertElementToTable, placeIntoInlineFrame, placeIntoInlineCopy, setContent, insertTextAsContent, applyTableStyle, applyCellStyle, applyObjectStyle, placeIntoFrame, placeIntoCopy, importXML, evaluateXPathExpression, findText, changeText, findGrep, changeGrep, findTransliterate, changeTransliterate, exportFile, asynchronousExportFile, remove, select, toSource, getElements, toSpecifier, addEventListener, removeEventListener
Boolean, Cell, Cells, Characters, Document, EPSs, EventListeners, Events, Graphic, Graphics, Images, InsertionPoint, InsertionPoints, Lines, Movie, Number, Object, PDFs, PICTs, PageItem, PageItems, Paragraphs, Sound, SpecialCharacters, Stories, Story, String, Table, Tables, Text, TextColumns, TextStyleRanges, Texts, WMFs, Words, XMLAttributes, XMLComments, XMLElement, XMLElements, XMLInstructions, XMLItems, XMLTag,
|
Property |
Type |
Access |
Description |
|---|---|---|---|
|
cells |
readonly |
A collection of table cells. |
|
|
characters |
readonly |
A collection of characters. |
|
|
contents |
SpecialCharacters.AUTO_PAGE_NUMBER SpecialCharacters.NEXT_PAGE_NUMBER SpecialCharacters.PREVIOUS_PAGE_NUMBER SpecialCharacters.SECTION_MARKER SpecialCharacters.BULLET_CHARACTER SpecialCharacters.COPYRIGHT_SYMBOL SpecialCharacters.DEGREE_SYMBOL SpecialCharacters.ELLIPSIS_CHARACTER SpecialCharacters.FORCED_LINE_BREAK SpecialCharacters.PARAGRAPH_SYMBOL SpecialCharacters.REGISTERED_TRADEMARK SpecialCharacters.SECTION_SYMBOL SpecialCharacters.TRADEMARK_SYMBOL SpecialCharacters.RIGHT_INDENT_TAB SpecialCharacters.INDENT_HERE_TAB SpecialCharacters.EM_DASH SpecialCharacters.EN_DASH SpecialCharacters.DISCRETIONARY_HYPHEN SpecialCharacters.NONBREAKING_HYPHEN SpecialCharacters.END_NESTED_STYLE SpecialCharacters.DOUBLE_LEFT_QUOTE SpecialCharacters.DOUBLE_RIGHT_QUOTE SpecialCharacters.SINGLE_LEFT_QUOTE SpecialCharacters.SINGLE_RIGHT_QUOTE SpecialCharacters.EM_SPACE SpecialCharacters.EN_SPACE SpecialCharacters.FLUSH_SPACE SpecialCharacters.HAIR_SPACE SpecialCharacters.NONBREAKING_SPACE SpecialCharacters.THIN_SPACE SpecialCharacters.FIGURE_SPACE SpecialCharacters.PUNCTUATION_SPACE SpecialCharacters.COLUMN_BREAK SpecialCharacters.FRAME_BREAK SpecialCharacters.PAGE_BREAK SpecialCharacters.ODD_PAGE_BREAK SpecialCharacters.EVEN_PAGE_BREAK SpecialCharacters.FOOTNOTE_SYMBOL SpecialCharacters.LEFT_TO_RIGHT_EMBEDDING SpecialCharacters.RIGHT_TO_LEFT_EMBEDDING SpecialCharacters.POP_DIRECTIONAL_FORMATTING SpecialCharacters.LEFT_TO_RIGHT_OVERRIDE SpecialCharacters.RIGHT_TO_LEFT_OVERRIDE SpecialCharacters.DOTTED_CIRCLE SpecialCharacters.ZERO_WIDTH_JOINER SpecialCharacters.TEXT_VARIABLE SpecialCharacters.SINGLE_STRAIGHT_QUOTE SpecialCharacters.DOUBLE_STRAIGHT_QUOTE SpecialCharacters.DISCRETIONARY_LINE_BREAK SpecialCharacters.ZERO_WIDTH_NONJOINER SpecialCharacters.THIRD_SPACE SpecialCharacters.QUARTER_SPACE SpecialCharacters.SIXTH_SPACE SpecialCharacters.FIXED_WIDTH_NONBREAKING_SPACE SpecialCharacters.HEBREW_MAQAF SpecialCharacters.HEBREW_GERESH SpecialCharacters.HEBREW_GERSHAYIM SpecialCharacters.ARABIC_KASHIDA SpecialCharacters.ARABIC_COMMA SpecialCharacters.ARABIC_SEMICOLON SpecialCharacters.ARABIC_QUESTION_MARK SpecialCharacters.LEFT_TO_RIGHT_MARK SpecialCharacters.RIGHT_TO_LEFT_MARK SpecialCharacters.HEBREW_SOF_PASUK |
read/write |
The contents of the text. Can return: String or SpecialCharacters enumerator. |
|
epss |
readonly |
A collection of EPS files. |
|
|
eventListeners |
readonly |
A collection of event listeners. |
|
|
events |
readonly |
A collection of events. |
|
|
graphics |
readonly |
A collection of imported graphics in any graphic file format (vector, metafile, or bitmap). |
|
|
id |
readonly |
The unique ID of the XMLElement. |
|
|
images |
readonly |
A collection of bitmap images in any bitmap file format (including TIFF, JPEG, or GIF). |
|
|
index |
readonly |
The index of the XMLElement within its containing object. |
|
|
insertionPoints |
readonly |
A collection of insertion points. |
|
|
isValid |
readonly |
Returns true if the object specifier resolves to valid objects. |
|
|
lines |
readonly |
A collection of lines. |
|
|
markupTag |
read/write |
The XML tag applied to the element. Can also accept: String. |
|
|
pageItems |
readonly |
The 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. |
|
|
paragraphs |
readonly |
A collection of paragraphs. |
|
|
parent |
readonly |
The parent of the XMLElement (a Document or XMLElement). |
|
|
parentStory |
readonly |
The story that contains the text. |
|
|
pdfs |
readonly |
A collection of PDF files. |
|
|
picts |
readonly |
A collection of PICT graphics. |
|
|
properties |
read/write |
A property that allows setting of several properties at the same time. |
|
|
stories |
readonly |
A collection of stories. |
|
|
storyOffset |
readonly |
The insertion point before the table in the story containing the table. |
|
|
tables |
readonly |
A collection of tables. |
|
|
textColumns |
readonly |
A collection of text columns. |
|
|
textStyleRanges |
readonly |
A collection of text style ranges. |
|
|
texts |
readonly |
A collection of text objects. |
|
|
wmfs |
readonly |
A collection of WMF graphics. |
|
|
words |
readonly |
A collection of words. |
|
|
xmlAttributes |
readonly |
A collection of XML attributes. |
|
|
xmlComments |
readonly |
A collection of XML comments. |
|
|
xmlContent |
readonly |
The text content or page item referred to by the element. Can return: Text, Story, PageItem, Movie, Sound, Graphic, Table or Cell. |
|
|
xmlElements |
readonly |
A collection of XML elements. |
|
|
xmlInstructions |
readonly |
A collection of XML instructions. |
|
|
xmlItems |
readonly |
A collection of XML items. |
EventListener addEventListener (eventType:String, handler:Varies, [captures:Boolean=Boolean])
Adds an event listener.
|
Parameter |
Type |
Description |
|---|---|---|
|
eventType |
The event type. |
|
|
handler |
Varies |
The event handler. Can accept: File or JavaScript Function. |
|
captures |
This parameter is obsolete. (Optional) (default: false) |
undefined applyCellStyle (using:Varies, [clearingOverrides:Boolean=Boolean])
Applies a cell style to the table cells associated with the XMLElement.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The cell style to apply. Can accept: String or CellStyle. |
|
clearingOverrides |
If true, removes local formatting before applying the cell style. (Optional) (default: true) |
undefined applyCharacterStyle (using:Varies)
Applies the specified character style to the text content of the XMLElement.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The character style to apply. Can accept: String or CharacterStyle. |
undefined applyObjectStyle (using:Varies, [clearingOverrides:Boolean=Boolean], [clearingOverridesThroughRootObjectStyle:Boolean=Boolean])
Applies an object style to the frame associated with the XMLElement.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The object style to apply. Can accept: String or ObjectStyle. |
|
clearingOverrides |
If true, removes local formatting before applying the object style. (Optional) (default: true) |
|
|
clearingOverridesThroughRootObjectStyle |
If true, clears unchecked category attributes through the root style. (Optional) (default: false) |
undefined applyParagraphStyle (using:Varies, [clearingOverrides:Boolean=Boolean])
Applies the specified paragraph style to the text content of the XMLElement.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The paragraph style to apply. Can accept: String or ParagraphStyle. |
|
clearingOverrides |
If true, clears any attributes before applying the style. (Optional) (default: true) |
undefined applyTableStyle (using:Varies, [clearingOverrides:Boolean=Boolean])
Applies a table style to the table associated with the XMLElement.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The table style to apply. Can accept: String or TableStyle. |
|
clearingOverrides |
If true, removes local formatting before applying the table style. (Optional) (default: true) |
BackgroundTask asynchronousExportFile (format:Varies, to:File, [showingOptions:Boolean=Boolean], using:PDFExportPreset, versionComments:String, [forceSave:Boolean=Boolean])
asynchronously exports the object(s) to a file.
|
Parameter |
Type |
Description |
|---|---|---|
|
format |
Varies |
The export format, specified as an enumeration value or as an extension that appears in the Save as type or Format menu in the Export dialog. Can accept: ExportFormat enumerator or String. |
|
to |
The path to the export file. |
|
|
showingOptions |
If true, displays the export options dialog. (Optional) (default: false) |
|
|
using |
The export style. (Optional) |
|
|
versionComments |
The comment for this version. (Optional) |
|
|
forceSave |
If true, forcibly saves a version. (Optional) (default: false) |
Text changeGrep (reverseOrder:Boolean)
Finds text that matches the find what value and replaces the text with the change to value.
|
Parameter |
Type |
Description |
|---|---|---|
|
reverseOrder |
If true, returns the results in reverse order. (Optional) |
Text changeText (reverseOrder:Boolean)
Finds text that matches the find what value and replaces the text with the change to value.
|
Parameter |
Type |
Description |
|---|---|---|
|
reverseOrder |
If true, returns the results in reverse order. (Optional) |
Text changeTransliterate (reverseOrder:Boolean)
Finds text that matches the find character type value and replaces the text with the change character type value.
|
Parameter |
Type |
Description |
|---|---|---|
|
reverseOrder |
If true, returns the results in reverse order. (Optional) |
Table convertElementToTable (rowTag:XMLTag, cellTag:XMLTag)
Converts the content of the XML element to a table.
|
Parameter |
Type |
Description |
|---|---|---|
|
rowTag |
The XML tag that indicates a table row. |
|
|
cellTag |
The XML tag that indicates a table cell. |
XMLAttribute convertToAttribute (using:String)
Converts the XMLElement to an attribute of its parent element.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
The name to give to the new attribute. (Optional) |
XMLElement duplicate ()
Duplicates the XMLElement.
XMLItem evaluateXPathExpression (using:String, prefixMappingTable:Array of Varies)
Evaluates an XPath expression starting at this XML element in the structure.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
The XPath expression. |
|
|
prefixMappingTable |
Array of Varies |
The namespace mapping table. Can accept: Array of Arrays of 2 Strings. (Optional) |
undefined exportFile (format:Varies, to:File, [showingOptions:Boolean=Boolean], using:PDFExportPreset, versionComments:String, [forceSave:Boolean=Boolean])
Exports the object(s) to a file.
|
Parameter |
Type |
Description |
|---|---|---|
|
format |
Varies |
The export format, specified as an enumeration value or as an extension that appears in the Save as type or Format menu in the Export dialog. Can accept: ExportFormat enumerator or String. |
|
to |
The path to the export file. |
|
|
showingOptions |
If true, displays the export options dialog. (Optional) (default: false) |
|
|
using |
The export style. (Optional) |
|
|
versionComments |
The comment for this version. (Optional) |
|
|
forceSave |
If true, forcibly saves a version. (Optional) (default: false) |
Text findGrep (reverseOrder:Boolean)
Finds text that matches the find what value.
|
Parameter |
Type |
Description |
|---|---|---|
|
reverseOrder |
If true, returns the results in reverse order. (Optional) |
Text findText (reverseOrder:Boolean)
Finds text that matches the find what value.
|
Parameter |
Type |
Description |
|---|---|---|
|
reverseOrder |
If true, returns the results in reverse order. (Optional) |
Text findTransliterate (reverseOrder:Boolean)
Finds text that matches the find character type value.
|
Parameter |
Type |
Description |
|---|---|---|
|
reverseOrder |
If true, returns the results in reverse order. (Optional) |
XMLElement getElements ()
Resolves the object specifier, creating an array of object references.
undefined importXML (from:File)
Imports the specified XML file into an InDesign document.
|
Parameter |
Type |
Description |
|---|---|---|
|
from |
The XML file. |
Text insertTextAsContent (using:Varies, position:XMLElementPosition)
Inserts the specified text as content before, in, or after the XML element.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The text to be inserted. Can accept: String or SpecialCharacters enumerator. |
|
position |
XMLElementPosition.BEFORE_ELEMENT XMLElementPosition.AFTER_ELEMENT XMLElementPosition.ELEMENT_START XMLElementPosition.ELEMENT_END |
The position at which to insert the text. Note that text inserted before or after the element does not become part of the content of the element. Instead, it becomes content of the parent of the element. |
undefined markup (using:Varies)
Associates the object with the specified XML element while preserving existing content.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The object to mark up. Can accept: PageItem, Movie, Sound, Graphic, Story, Text or Table. |
XMLElement move (to:LocationOptions, reference:Varies)
Moves the element to the specified location.
|
Parameter |
Type |
Description |
|---|---|---|
|
to |
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. |
|
reference |
Varies |
The reference object. Note: Required when the to parameter specifies before or after. . Can accept: XMLItem or Text. (Optional) |
PageItem placeIntoCopy (on:Varies, placePoint:Array of Number String, copyItem:PageItem, [retainExistingFrame:Boolean=Boolean])
Associates the XML element with a copy of a page item.
|
Parameter |
Type |
Description |
|---|---|---|
|
on |
Varies |
The page or spread on which to create the new page item. Can accept: Spread, Page or MasterSpread. |
|
placePoint |
The page coordinates of the top left corner of the page item, in the format [y1, x1] |
|
|
copyItem |
The page item to copy. |
|
|
retainExistingFrame |
If true, associates the XML element with the existing page item and moves the page item (rather than a copy of the page item). (Optional) (default: false) |
PageItem placeIntoFrame (on:Varies, geometricBounds:Array of Number String)
Places the XML element into a new rectangular page item. If the XML element was already associated with a page item, that page item is deleted.
|
Parameter |
Type |
Description |
|---|---|---|
|
on |
Varies |
The page or spread on which to create the new page item. Can accept: Spread, Page or MasterSpread. |
|
geometricBounds |
The bounds of the page item excluding the stroke width, in the format [y1, x1, y2, x2]. |
PageItem placeIntoInlineCopy (copyItem:PageItem, [retainExistingFrame:Boolean=Boolean])
Associates an existing page item with the XML element and places it into an inline frame.
|
Parameter |
Type |
Description |
|---|---|---|
|
copyItem |
The page item to copy. |
|
|
retainExistingFrame |
If true, moves the existing page item. If false, moves a copy of the page item. (Optional) (default: false) |
PageItem placeIntoInlineFrame (dimensions:Array of Number String)
Places an XML element into an inline frame.
|
Parameter |
Type |
Description |
|---|---|---|
|
dimensions |
The dimensions of the inline frame in the format [width, height]. |
undefined placeXML (using:Varies)
Places XML content into the story, replacing the existing content.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
Varies |
The object to place into. Can accept: Story, PageItem, Graphic, Movie or Sound. |
undefined remove ()
Deletes the XMLElement.
Boolean removeEventListener (eventType:String, handler:Varies, [captures:Boolean=Boolean])
Removes the event listener.
|
Parameter |
Type |
Description |
|---|---|---|
|
eventType |
The registered event type. |
|
|
handler |
Varies |
The registered event handler. Can accept: File or JavaScript Function. |
|
captures |
This parameter is obsolete. (Optional) (default: false) |
undefined select ([existingSelection:SelectionOptions=SelectionOptions])
Selects the object.
|
Parameter |
Type |
Description |
|---|---|---|
|
existingSelection |
SelectionOptions.ADD_TO SelectionOptions.REMOVE_FROM SelectionOptions.REPLACE_WITH SelectionOptions.SET_KEY |
The selection status of the XMLElement in relation to previously selected objects. (Optional) (default: SelectionOptions.REPLACE_WITH) |
PageItem setContent (using:String, relativeBasePath:String)
Replaces the content of XML element with content imported from a file.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
The file path to the import file. |
|
|
relativeBasePath |
Base path used to resolve relative paths. (Optional) |
Asset store (using:Library, withProperties:Object)
Stores the object in the specified library.
|
Parameter |
Type |
Description |
|---|---|---|
|
using |
The library in which to store the object. |
|
|
withProperties |
Initial values for properties of the new XMLElement (Optional) |
String toSource ()
Generates a string which, if executed, will return the XMLElement.
String toSpecifier ()
Retrieves the object specifier.
undefined untag ()
Untags an element.
ValidationError validate ([maximumErrors:Number=Number])
Validates the element against a DTD.
|
Parameter |
Type |
Description |
|---|---|---|
|
maximumErrors |
The maximum number of validation errors to generate. (Optional) (default: 250) |
ValidationError.element
Cell.parent
Character.parent
EPS.parent
Event.parent
EventListener.parent
Graphic.parent
Image.parent
InsertionPoint.parent
Line.parent
MutationEvent.parent
PDF.parent
PICT.parent
PageItem.parent
Paragraph.parent
Story.parent
Table.parent
Text.parent
TextColumn.parent
TextStyleRange.parent
WMF.parent
Word.parent
XMLAttribute.parent
XMLComment.parent
XMLElement.parent
XMLInstruction.parent
XMLItem.parent