XMLElement
QuickLinks
Hierarchy
Properties
Property | Type | Access | Description |
---|---|---|---|
cells | Cells Cell | readonly | A collection of table cells. |
characters | Characters Character | readonly | A collection of characters. |
contents | SpecialCharactersString | r/w | The contents of the text. Can return: String or SpecialCharacters enumerator. |
epss | EPSs EPS | readonly | A collection of EPS files. |
eventListeners | EventListeners EventListener | readonly | A collection of event listeners. |
events | Events Event | readonly | A collection of events. |
graphics | Graphics Graphic | readonly | A collection of imported graphics in any graphic file format (vector, metafile, or bitmap). |
id | number | readonly | The unique ID of the XMLElement. |
images | Images Image | readonly | A collection of bitmap images in any bitmap file format (including TIFF, JPEG, or GIF). |
index | number | readonly | The index of the XMLElement within its containing object. |
insertionPoints | InsertionPoints InsertionPoint | readonly | A collection of insertion points. |
isValid | bool | readonly | Returns true if the object specifier resolves to valid objects. |
lines | Lines Line | readonly | A collection of lines. |
markupTag | String XMLTag |
r/w | The XML tag applied to the element. Can also accept: String. |
pageItems | PageItems PageItem | 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 | Paragraphs Paragraph | readonly | A collection of paragraphs. |
parent | Document XMLElement |
readonly | The parent of the XMLElement (a Document or XMLElement). |
parentStory | Story | readonly | The story that contains the text. |
pdfs | PDFs PDF | readonly | A collection of PDF files. |
picts | PICTs PICT | readonly | A collection of PICT graphics. |
properties | Object | r/w | A property that allows setting of several properties at the same time. |
stories | Stories Story | readonly | A collection of stories. |
storyOffset | InsertionPoint | readonly | The insertion point before the table in the story containing the table. |
tables | Tables Table | readonly | A collection of tables. |
textColumns | TextColumns TextColumn | readonly | A collection of text columns. |
textStyleRanges | TextStyleRanges TextStyleRange | readonly | A collection of text style ranges. |
texts | Texts Text | readonly | A collection of text objects. |
wmfs | WMFs WMF | readonly | A collection of WMF graphics. |
words | Words Word | readonly | A collection of words. |
xmlAttributes | XMLAttributes XMLAttribute | readonly | A collection of XML attributes. |
xmlComments | XMLComments XMLComment | readonly | A collection of XML comments. |
xmlContent | Cell Graphic Movie PageItem Sound Story Table Text |
readonly | The text content or page item referred to by the element. Can return: Text, Story, PageItem, Movie, Sound, Graphic, Table or Cell. |
xmlElements | XMLElements XMLElement | readonly | A collection of XML elements. |
xmlInstructions | XMLInstructions XMLInstruction | readonly | A collection of XML instructions. |
xmlItems | XMLItems XMLItem | readonly | A collection of XML items. |
Methods
Instances
EventListener addEventListener (eventType:
string, handler:
varies[, captures:
bool=false])
Adds an event listener.
Parameter | Type | Description |
---|---|---|
eventType | string | The event type. |
handler | File JavaScript Function | The event handler. Can accept: File or JavaScript Function. |
captures | bool | This parameter is obsolete. (Optional) (default: false) |
void applyCellStyle (using:
varies[, clearingOverrides:
bool=true])
Applies a cell style to the table cells associated with the XMLElement.
Parameter | Type | Description |
---|---|---|
using | CellStyle String | The cell style to apply. Can accept: String or CellStyle. |
clearingOverrides | bool | If true, removes local formatting before applying the cell style. (Optional) (default: true) |
void applyCharacterStyle (using:
varies)
Applies the specified character style to the text content of the XMLElement.
Parameter | Type | Description |
---|---|---|
using | CharacterStyle String | The character style to apply. Can accept: String or CharacterStyle. |
void applyParagraphStyle (using:
varies[, clearingOverrides:
bool=true])
Applies the specified paragraph style to the text content of the XMLElement.
Parameter | Type | Description |
---|---|---|
using | ParagraphStyle String | The paragraph style to apply. Can accept: String or ParagraphStyle. |
clearingOverrides | bool | If true, clears any attributes before applying the style. (Optional) (default: true) |
void applyTableStyle (using:
varies[, clearingOverrides:
bool=true])
Applies a table style to the table associated with the XMLElement.
Parameter | Type | Description |
---|---|---|
using | String TableStyle | The table style to apply. Can accept: String or TableStyle. |
clearingOverrides | bool | If true, removes local formatting before applying the table style. (Optional) (default: true) |
Array
of Text changeGrep ([reverseOrder:
bool])
Finds text that matches the find what value and replaces the text with the change to value.
Parameter | Type | Description |
---|---|---|
reverseOrder | bool | If true, returns the results in reverse order. (Optional) |
Array
of Text changeText ([reverseOrder:
bool])
Finds text that matches the find what value and replaces the text with the change to value.
Parameter | Type | Description |
---|---|---|
reverseOrder | bool | If true, returns the results in reverse order. (Optional) |
Array
of Text changeTransliterate ([reverseOrder:
bool])
Finds text that matches the find character type value and replaces the text with the change character type value.
Parameter | Type | Description |
---|---|---|
reverseOrder | bool | 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 | XMLTag | The XML tag that indicates a table row. |
cellTag | XMLTag | 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 | string | The name to give to the new attribute. (Optional) |
XMLElement duplicate ()
Duplicates the XMLElement.
Array
of XMLItem evaluateXPathExpression (using:
string[, prefixMappingTable:
Array
of varies])
Evaluates an XPath expression starting at this XML element in the structure.
Parameter | Type | Description |
---|---|---|
using | string | The XPath expression. |
prefixMappingTable |
Array
of : Array of Arrays of 2 Strings | The namespace mapping table. Can accept: Array of Arrays of 2 Strings. (Optional) |
Array
of Text findGrep ([reverseOrder:
bool])
Finds text that matches the find what value.
Parameter | Type | Description |
---|---|---|
reverseOrder | bool | If true, returns the results in reverse order. (Optional) |
Array
of Text findText ([reverseOrder:
bool])
Finds text that matches the find what value.
Parameter | Type | Description |
---|---|---|
reverseOrder | bool | If true, returns the results in reverse order. (Optional) |
Array
of Text findTransliterate ([reverseOrder:
bool])
Finds text that matches the find character type value.
Parameter | Type | Description |
---|---|---|
reverseOrder | bool | If true, returns the results in reverse order. (Optional) |
Array
of XMLElement getElements ()
Resolves the object specifier, creating an array of object references.
void importXML (from:
File)
Imports the specified XML file into an InDesign document.
Parameter | Type | Description |
---|---|---|
from | File | 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 | SpecialCharacters String | The text to be inserted. Can accept: String or SpecialCharacters enumerator. |
position | XMLElementPosition: 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. |
void markup (using:
Text)
Associates the specified text with an XML element while preserving exisxting content.
Parameter | Type | Description |
---|---|---|
using | Text | The text to mark up. |
XMLElement move (to:
LocationOptions[, reference:
varies])
Moves the element to the specified location.
Parameter | Type | Description |
---|---|---|
to | LocationOptions: 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 | Text XMLItem | The reference object. Note: Required when the to parameter specifies before or after. . Can accept: XMLItem or Text. (Optional) |
PageItem placeIntoInlineCopy (copyItem:
PageItem[, retainExistingFrame:
bool=false])
Associates an existing page item with the XML element and places it into an inline frame.
Parameter | Type | Description |
---|---|---|
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) (default: false) |
PageItem placeIntoInlineFrame (dimensions:
Array
of Measurement Unit (Number or String))
Places an XML element into an inline frame.
Parameter | Type | Description |
---|---|---|
dimensions | Array of Measurement Unit (Number or String) | The dimensions of the inline frame in the format [width, height]. |
void placeXML (using:
Story)
Places XML content into a story, replacing the existing content.
Parameter | Type | Description |
---|---|---|
using | Story | The story to associate with the XML element. |
void remove ()
Deletes the XMLElement.
bool removeEventListener (eventType:
string, handler:
varies[, captures:
bool=false])
Removes the event listener.
Parameter | Type | Description |
---|---|---|
eventType | string | The registered event type. |
handler | File JavaScript Function | The registered event handler. Can accept: File or JavaScript Function. |
captures | bool | This parameter is obsolete. (Optional) (default: false) |
void select ([existingSelection:
SelectionOptions=SelectionOptions.REPLACE_WITH])
Selects the object.
Parameter | Type | Description |
---|---|---|
existingSelection | SelectionOptions: 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) |
PageItem setContent (using:
string[, relativeBasePath:
string])
Replaces the content of XML element with content imported from a file.
Parameter | Type | Description |
---|---|---|
using | string | The file path to the import file. |
relativeBasePath | string | Base path used to resolve relative paths. (Optional) |
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.
Parameter | Type | Description |
---|---|---|
maximumErrors | number | The maximum number of validation errors to generate. (Optional) (default: 250) |
Element of
Story.parent
ValidationError.element
XMLAttribute.parent
XMLComment.parent
XMLElement.parent
XMLInstruction.parent
XMLItem.parent
Used in:
void Button.placeXML (using: XMLElement)
void Character.markup (using: XMLElement)
void CheckBox.placeXML (using: XMLElement)
void ComboBox.placeXML (using: XMLElement)
void EPS.placeXML (using: XMLElement)
void EPSText.placeXML (using: XMLElement)
void FormField.placeXML (using: XMLElement)
void Graphic.placeXML (using: XMLElement)
void GraphicLine.placeXML (using: XMLElement)
void Group.placeXML (using: XMLElement)
void HtmlItem.placeXML (using: XMLElement)
void Image.placeXML (using: XMLElement)
void ImportedPage.placeXML (using: XMLElement)
void InsertionPoint.markup (using: XMLElement)
void Line.markup (using: XMLElement)
void ListBox.placeXML (using: XMLElement)
void MediaItem.placeXML (using: XMLElement)
void Movie.placeXML (using: XMLElement)
void MultiStateObject.placeXML (using: XMLElement)
void Oval.placeXML (using: XMLElement)
void PDF.placeXML (using: XMLElement)
void PICT.placeXML (using: XMLElement)
void PageItem.placeXML (using: XMLElement)
void Paragraph.markup (using: XMLElement)
void Polygon.placeXML (using: XMLElement)
void RadioButton.placeXML (using: XMLElement)
void Rectangle.placeXML (using: XMLElement)
void SignatureField.placeXML (using: XMLElement)
void Sound.placeXML (using: XMLElement)
void SplineItem.placeXML (using: XMLElement)
void Story.placeXML (using: XMLElement)
void Text.markup (using: XMLElement)
void TextBox.placeXML (using: XMLElement)
void TextColumn.markup (using: XMLElement)
void TextFrame.placeXML (using: XMLElement)
void TextStyleRange.markup (using: XMLElement)
void WMF.placeXML (using: XMLElement)
void Word.markup (using: XMLElement)
XMLElement XMLElements.nextItem (obj: XMLElement)
XMLElement XMLElements.previousItem (obj: XMLElement)
Return
XMLElement XMLAttribute.convertToElement ([located: XMLElementLocation=XMLElementLocation.ELEMENT_START][, markupTag: XMLTag])
XMLElement XMLElement.duplicate ()
Array of XMLElement XMLElement.getElements ()
XMLElement XMLElement.move (to: LocationOptions[, reference: varies])
XMLElement XMLElements.[] (index: number)
XMLElement XMLElements.add (markupTag: varies[, xmlContent: varies][, withProperties: Object])
XMLElement XMLElements.anyItem ()
Array of XMLElement XMLElements.everyItem ()
XMLElement XMLElements.firstItem ()
XMLElement XMLElements.item (index: varies)
XMLElement XMLElements.itemByID (id: number)
Array of XMLElement XMLElements.itemByRange (from: varies, to: varies)
XMLElement XMLElements.lastItem ()
XMLElement XMLElements.middleItem ()
XMLElement XMLElements.nextItem (obj: XMLElement)
XMLElement XMLElements.previousItem (obj: XMLElement)
Jongware, 29-Apr-2012 v3.0.3i | Contents :: Index |