XMLXMLElement

An XML element.

Extends

Instance Properties

Name Description Access
cells Cells A collection of table cells. read-only
characters Characters A collection of characters. read-only
contents The contents of the text. Can return: String or SpecialCharacters enumerator. read-write
epss EPSs A collection of EPS files. read-only
eventListeners EventListeners A collection of event listeners. read-only
events Events A collection of events. read-only
graphics Graphics A collection of imported graphics in any graphic file format (vector, metafile, or bitmap). read-only
id number The unique ID of the XMLElement. read-only
images Images A collection of bitmap images in any bitmap file format (including TIFF, JPEG, or GIF). read-only
index number The index of the XMLElement within its containing object. read-only
insertionPoints InsertionPoints A collection of insertion points. read-only
isValid bool Returns true if the object specifier resolves to valid objects. read-only
lines Lines A collection of lines. read-only
markupTag XMLTag The XML tag applied to the element. Can also accept: String. read-write
pageItems PageItems 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. read-only
paragraphs Paragraphs A collection of paragraphs. read-only
parent The parent of the XMLElement (a Document or XMLElement). read-only
parentStory Story The story that contains the text. read-only
pdfs PDFs A collection of PDF files. read-only
picts PICTs A collection of PICT graphics. read-only
properties Object A property that allows setting of several properties at the same time. read-write
stories Stories A collection of stories. read-only
storyOffset InsertionPoint The insertion point before the table in the story containing the table. read-only
tables Tables A collection of tables. read-only
textColumns TextColumns A collection of text columns. read-only
textStyleRanges TextStyleRanges A collection of text style ranges. read-only
texts Texts A collection of text objects. read-only
wmfs WMFs A collection of WMF graphics. read-only
words Words A collection of words. read-only
xmlAttributes XMLAttributes A collection of XML attributes. read-only
xmlComments XMLComments A collection of XML comments. read-only
xmlContent The text content or page item referred to by the element. Can return: Text, Story, PageItem, Movie, Sound, Graphic, Table or Cell. read-only
xmlElements XMLElements A collection of XML elements. read-only
xmlInstructions XMLInstructions A collection of XML instructions. read-only
xmlItems XMLItems A collection of XML items. read-only

Methods

addEventListener(
eventType, handler ​[, captures])
 → EventListener
applyCellStyle(
using ​[, clearingOverrides])
applyObjectStyle(
using ​[, clearingOverrides] ​[, clearingOverridesThroughRootObjectStyle])
applyParagraphStyle(
using ​[, clearingOverrides])
applyTableStyle(
using ​[, clearingOverrides])
asynchronousExportFile(
format, to ​[, showingOptions] ​[, using] ​[, versionComments] ​[, forceSave])
 → BackgroundTask
changeGrep(
[reverseOrder])
 → Text
changeText(
[reverseOrder])
 → Text
changeTransliterate(
[reverseOrder])
 → Text
convertElementToTable(
rowTag, cellTag)
 → Table
evaluateXPathExpression(
using, prefixMappingTable)
 → XMLItem
exportFile(
format, to ​[, showingOptions] ​[, using] ​[, versionComments] ​[, forceSave])
findGrep(
[reverseOrder])
 → Text
findText(
[reverseOrder])
 → Text
findTransliterate(
[reverseOrder])
 → Text
importXML(
from)
insertTextAsContent(
using, position)
 → Text
markup(
using)
move(
to, reference)
 → XMLElement
placeIntoCopy(
on, placePoint, copyItem ​[, retainExistingFrame])
 → PageItem
placeIntoFrame(
on, geometricBounds)
 → PageItem
placeIntoInlineCopy(
copyItem ​[, retainExistingFrame])
 → PageItem
placeIntoInlineFrame(
dimensions)
 → PageItem
placeXML(
using)
remove(
)
removeEventListener(
eventType, handler ​[, captures])
 → bool
select(
[existingSelection])
setContent(
using ​[, relativeBasePath])
 → PageItem
store(
using ​[, withProperties])
 → Asset
toSource(
)
 → string
toSpecifier(
)
 → string
untag(
)
validate(
[maximumErrors])
 → ValidationError
addEventListener(
eventType, handler ​[, captures=false])
 → EventListener
Adds an event listener.
eventType string The event type.
handler The event handler. Can accept: File or JavaScript Function.
captures bool This parameter is obsolete. (Optional)
applyCellStyle(
using ​[, clearingOverrides=true])
Applies a cell style to the table cells associated with the XMLElement.
using The cell style to apply. Can accept: String or CellStyle.
clearingOverrides bool If true, removes local formatting before applying the cell style. (Optional)
applyCharacterStyle(
using)
Applies the specified character style to the text content of the XMLElement.
using The character style to apply. Can accept: String or CharacterStyle.
applyObjectStyle(
using ​[, clearingOverrides=true] ​[, clearingOverridesThroughRootObjectStyle=false])
Applies an object style to the frame associated with the XMLElement.
using The object style to apply. Can accept: String or ObjectStyle.
clearingOverrides bool If true, removes local formatting before applying the object style. (Optional)
clearingOverridesThroughRootObjectStyle bool If true, clears unchecked category attributes through the root style. (Optional)
applyParagraphStyle(
using ​[, clearingOverrides=true])
Applies the specified paragraph style to the text content of the XMLElement.
using The paragraph style to apply. Can accept: String or ParagraphStyle.
clearingOverrides bool If true, clears any attributes before applying the style. (Optional)
applyTableStyle(
using ​[, clearingOverrides=true])
Applies a table style to the table associated with the XMLElement.
using The table style to apply. Can accept: String or TableStyle.
clearingOverrides bool If true, removes local formatting before applying the table style. (Optional)
asynchronousExportFile(
format, to ​[, showingOptions=false] ​[, using] ​[, versionComments] ​[, forceSave=false])
 → BackgroundTask
asynchronously exports the object(s) to a file.
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 File The path to the export file.
showingOptions bool If true, displays the export options dialog. (Optional)
using PDFExportPreset The export style. (Optional)
versionComments string The comment for this version. (Optional)
forceSave bool If true, forcibly saves a version. (Optional)
changeGrep(
[reverseOrder])
 → Text
Finds text that matches the find what value and replaces the text with the change to value.
reverseOrder bool If true, returns the results in reverse order. (Optional)
changeText(
[reverseOrder])
 → Text
Finds text that matches the find what value and replaces the text with the change to value.
reverseOrder bool If true, returns the results in reverse order. (Optional)
changeTransliterate(
[reverseOrder])
 → Text
Finds text that matches the find character type value and replaces the text with the change character type value.
reverseOrder bool If true, returns the results in reverse order. (Optional)
convertElementToTable(
rowTag, cellTag)
 → Table
Converts the content of the XML element to a table.
rowTag XMLTag The XML tag that indicates a table row.
cellTag XMLTag The XML tag that indicates a table cell.
convertToAttribute(
[using])
 → XMLAttribute
Converts the XMLElement to an attribute of its parent element.
using string The name to give to the new attribute. (Optional)
duplicate(
)
 → XMLElement
Duplicates the XMLElement.
evaluateXPathExpression(
using, prefixMappingTable)
 → XMLItem
Evaluates an XPath expression starting at this XML element in the structure.
using string The XPath expression.
prefixMappingTable The namespace mapping table. Can accept: Array of Arrays of 2 Strings. (Optional)
exportFile(
format, to ​[, showingOptions=false] ​[, using] ​[, versionComments] ​[, forceSave=false])
Exports the object(s) to a file.
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 File The path to the export file.
showingOptions bool If true, displays the export options dialog. (Optional)
using PDFExportPreset The export style. (Optional)
versionComments string The comment for this version. (Optional)
forceSave bool If true, forcibly saves a version. (Optional)
findGrep(
[reverseOrder])
 → Text
Finds text that matches the find what value.
reverseOrder bool If true, returns the results in reverse order. (Optional)
findText(
[reverseOrder])
 → Text
Finds text that matches the find what value.
reverseOrder bool If true, returns the results in reverse order. (Optional)
findTransliterate(
[reverseOrder])
 → Text
Finds text that matches the find character type value.
reverseOrder bool If true, returns the results in reverse order. (Optional)
getElements(
)
 → XMLElement
Resolves the object specifier, creating an array of object references.
importXML(
from)
Imports the specified XML file into an InDesign document.
from File The XML file.
insertTextAsContent(
using, position)
 → Text
Inserts the specified text as content before, in, or after the XML element.
using The text to be inserted. Can accept: String or SpecialCharacters enumerator.
position XMLElementPosition 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.
markup(
using)
Associates the object with the specified XML element while preserving existing content.
using The object to mark up. Can accept: PageItem, Movie, Sound, Graphic, Story, Text or Table.
move(
to, reference)
 → XMLElement
Moves the element to the specified location.
to LocationOptions 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)
placeIntoCopy(
on, placePoint, copyItem ​[, retainExistingFrame=false])
 → PageItem
Associates the XML element with a copy of a page item.
on The page or spread on which to create the new page item. Can accept: Spread, Page or MasterSpread.
placePoint Array<Measurement Unit (Number or String)=any> The page coordinates of the top left corner of the page item, in the format [y1, x1]
copyItem PageItem The page item to copy.
retainExistingFrame bool 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)
placeIntoFrame(
on, geometricBounds)
 → PageItem
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.
on The page or spread on which to create the new page item. Can accept: Spread, Page or MasterSpread.
geometricBounds Array<Measurement Unit (Number or String)=any> The bounds of the page item excluding the stroke width, in the format [y1, x1, y2, x2].
placeIntoInlineCopy(
copyItem ​[, retainExistingFrame=false])
 → PageItem
Associates an existing page item with the XML element and places it into an inline frame.
copyItem PageItem The page item to copy.
retainExistingFrame bool If true, moves the existing page item. If false, moves a copy of the page item. (Optional)
placeIntoInlineFrame(
dimensions)
 → PageItem
Places an XML element into an inline frame.
dimensions Array<Measurement Unit (Number or String)=any> The dimensions of the inline frame in the format [width, height].
placeXML(
using)
Places XML content into the story, replacing the existing content.
using The object to place into. Can accept: Story, PageItem, Graphic, Movie or Sound.
remove(
)
Deletes the XMLElement.
removeEventListener(
eventType, handler ​[, captures=false])
 → bool
Removes the event listener.
eventType string The registered event type.
handler The registered event handler. Can accept: File or JavaScript Function.
captures bool This parameter is obsolete. (Optional)
select(
[existingSelection=SelectionOptions.REPLACE_WITH])
Selects the object.
existingSelection SelectionOptions The selection status of the XMLElement in relation to previously selected objects. (Optional)
setContent(
using ​[, relativeBasePath])
 → PageItem
Replaces the content of XML element with content imported from a file.
using string The file path to the import file.
relativeBasePath string Base path used to resolve relative paths. (Optional)
store(
using ​[, withProperties])
 → Asset
Stores the object in the specified library.
using Library The library in which to store the object.
withProperties Object Initial values for properties of the new XMLElement (Optional)
toSource(
)
 → string
Generates a string which, if executed, will return the XMLElement.
toSpecifier(
)
 → string
Retrieves the object specifier.
untag(
)
Untags an element.
validate(
[maximumErrors=250])
 → ValidationError
Validates the element against a DTD.
maximumErrors number The maximum number of validation errors to generate. (Optional)