XMLElement
An XML element.
Go to Property Listing | Method Listing
Methods:
addEventListener, applyCellStyle, applyCharacterStyle, applyObjectStyle, applyParagraphStyle, applyTableStyle, asynchronousExportFile, changeGrep, changeText, changeTransliterate, convertElementToTable, convertToAttribute, duplicate, evaluateXPathExpression, exportFile, findGrep, findText, findTransliterate, getElements, importXML, insertTextAsContent, markup, move, placeIntoCopy, placeIntoFrame, placeIntoInlineCopy, placeIntoInlineFrame, placeXML, remove, removeEventListener, select, setContent, store, toSource, toSpecifier, untag, validate
Objects:
Boolean, Cell, Cells, Characters, EPSs, EventListeners, Events, Graphic, Graphics, Images, InsertionPoint, InsertionPoints, Lines, Movie, Number, Object, PDFs, PICTs, PageItem, PageItems, Paragraphs, SVGs, Sound, SpecialCharacters, Stories, Story, String, Table, Tables, Text, TextColumns, TextStyleRanges, Texts, WMFs, Words, XMLAttributes, XMLComments, XMLElements, XMLInstructions, XMLItems, XMLTag
Hierarchy:
Superclass: XMLItem
Class: XMLElement
Property Listing
Property |
Type |
Access |
Description |
---|---|---|---|
readonly |
A collection of table cells. |
||
readonly |
A collection of characters. |
||
read/write |
The contents of the text. Can return: String or SpecialCharacters enumerator. |
||
readonly |
A collection of EPS files. |
||
readonly |
A collection of event listeners. |
||
readonly |
A collection of events. |
||
readonly |
A collection of imported graphics in any graphic file format (vector, metafile, or bitmap). |
||
readonly |
The unique ID of the XMLElement. |
||
readonly |
A collection of bitmap images in any bitmap file format (including TIFF, JPEG, or GIF). |
||
readonly |
The index of the XMLElement within its containing object. |
||
readonly |
A collection of insertion points. |
||
readonly |
Returns true if the object specifier resolves to valid objects. |
||
readonly |
A collection of lines. |
||
read/write |
The XML tag applied to the element. Can also accept: String. |
||
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. |
||
readonly |
A collection of paragraphs. |
||
readonly |
The parent of the XMLElement (a Document or XMLElement). |
||
readonly |
The story that contains the text. |
||
readonly |
A collection of PDF files. |
||
readonly |
A collection of PICT graphics. |
||
read/write |
A property that allows setting of several properties at the same time. |
||
readonly |
A collection of stories. |
||
readonly |
The insertion point before the table in the story containing the table. |
||
readonly |
A collection of SVG files. |
||
readonly |
A collection of tables. |
||
readonly |
A collection of text columns. |
||
readonly |
A collection of text style ranges. |
||
readonly |
A collection of text objects. |
||
readonly |
A collection of WMF graphics. |
||
readonly |
A collection of words. |
||
readonly |
A collection of XML attributes. |
||
readonly |
A collection of XML comments. |
||
readonly |
The text content or page item referred to by the element. Can return: Text, Story, PageItem, Movie, Sound, Graphic, Table or Cell. |
||
readonly |
A collection of XML elements. |
||
readonly |
A collection of XML instructions. |
||
readonly |
A collection of XML items. |
Method Listing
EventListener addEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])
Adds an event listener.
Parameter |
Type |
Description |
---|---|---|
eventType |
The event type. |
|
handler |
JavaScriptFunction |
The event handler. Can accept: File or JavaScript Function. |
captures |
This parameter is obsolete. (Optional) (default: false) |
undefined applyCellStyle (using:Varies String CellStyle, [clearingOverrides:Boolean=Boolean])
Applies a cell style to the table cells associated with the XMLElement.
Parameter |
Type |
Description |
---|---|---|
using |
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 String CharacterStyle)
Applies the specified character style to the text content of the XMLElement.
Parameter |
Type |
Description |
---|---|---|
using |
The character style to apply. Can accept: String or CharacterStyle. |
undefined applyObjectStyle (using:Varies String ObjectStyle, [clearingOverrides:Boolean=Boolean], [clearingOverridesThroughRootObjectStyle:Boolean=Boolean])
Applies an object style to the frame associated with the XMLElement.
Parameter |
Type |
Description |
---|---|---|
using |
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 String ParagraphStyle, [clearingOverrides:Boolean=Boolean])
Applies the specified paragraph style to the text content of the XMLElement.
Parameter |
Type |
Description |
---|---|---|
using |
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 String TableStyle, [clearingOverrides:Boolean=Boolean])
Applies a table style to the table associated with the XMLElement.
Parameter |
Type |
Description |
---|---|---|
using |
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 ExportFormat String, to:File, [showingOptions:Boolean=Boolean], using:PDFExportPreset, versionComments:String, [forceSave:Boolean=Boolean])
asynchronously exports the object(s) to a file.
Parameter |
Type |
Description |
---|---|---|
format |
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 Arrays of 2 Strings. )
Evaluates an XPath expression starting at this XML element in the structure.
Parameter |
Type |
Description |
---|---|---|
using |
The XPath expression. |
|
prefixMappingTable |
Array of Arrays of 2 Strings. |
The namespace mapping table. Can accept: Array of Arrays of 2 Strings. (Optional) |
undefined exportFile (format:Varies ExportFormat String, to:File, [showingOptions:Boolean=Boolean], using:PDFExportPreset, versionComments:String, [forceSave:Boolean=Boolean])
Exports the object(s) to a file.
Parameter |
Type |
Description |
---|---|---|
format |
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 String SpecialCharacters, position:XMLElementPosition)
Inserts the specified text as content before, in, or after the XML element.
Parameter |
Type |
Description |
---|---|---|
using |
The text to be inserted. Can accept: String or SpecialCharacters enumerator. |
|
position |
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 Graphic Movie PageItem Sound Story Text Table)
Associates the object with the specified XML element while preserving existing content.
Parameter |
Type |
Description |
---|---|---|
using |
The object to mark up. Can accept: PageItem, Movie, Sound, Graphic, Story, Text or Table. |
XMLElement move (to:LocationOptions, reference:Varies XMLItem Text)
Moves the element to the specified location.
Parameter |
Type |
Description |
---|---|---|
to |
The location in relation to the reference object or within the containing object. |
|
reference |
The reference object. Note: Required when the to parameter specifies before or after. . Can accept: XMLItem or Text. (Optional) |
PageItem placeIntoCopy (on:Varies Page Spread MasterSpread, 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 |
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 Page Spread MasterSpread, 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 |
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 Graphic Movie PageItem Story Sound)
Places XML content into the story, replacing the existing content.
Parameter |
Type |
Description |
---|---|---|
using |
The object to place into. Can accept: Story, PageItem, Graphic, Movie or Sound. |
undefined remove ()
Deletes the XMLElement.
Boolean removeEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])
Removes the event listener.
Parameter |
Type |
Description |
---|---|---|
eventType |
The registered event type. |
|
handler |
JavaScriptFunction |
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 |
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) |
Object of
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
SVG.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