![]() | InDesign SDK 20.5 |
#include <IIDXMLElement.h>

Public Types | |
| enum | { kDefaultIID = IID_IIDXMLELEMENT } |
| enum | _Placement { kEndIndex = -2 } |
| typedef InDesign::TextRange | value_type |
| typedef XMLContentIterator | iterator |
| typedef XMLContentIterator | const_iterator |
| typedef const value_type * | pointer |
| typedef const value_type * | const_pointer |
| typedef const value_type & | reference |
| typedef const value_type & | const_reference |
| typedef K2Reverse_iterator < iterator, value_type, std::ptrdiff_t, pointer, reference > | reverse_iterator |
| typedef K2Reverse_iterator < const_iterator, value_type, std::ptrdiff_t, const_pointer, const_reference > | const_reverse_iterator |
Public Member Functions | |
| virtual const XMLReference & | GetXMLReference () const =0 |
| virtual void | SetXMLReference (const XMLReference &newXMLRef)=0 |
| virtual int32 | GetChildCount () const =0 |
| virtual XMLReference | GetNthChild (int32) const =0 |
| virtual const XMLReference & | GetParent () const =0 |
| virtual void | SetParent (const XMLReference &newParent)=0 |
| virtual XMLReference | FindChild (const WideString &tag, int32 index) const =0 |
| virtual int32 | FindChild (const XMLReference &childToFind) const =0 |
| virtual void | AddChildAt (const XMLReference &newChild, int32 indexAt, bool16 setChildsParent=kTrue)=0 |
| virtual void | RemoveChild (const XMLReference &childToRemove, bool16 resetChild=kTrue)=0 |
| virtual void | RemoveChild (int32 indexAt, bool16 resetChild=kTrue)=0 |
| virtual void | SetChildAt (const XMLReference &newChildXMLRef, int32 indexAt)=0 |
| virtual UID | GetTagUID () const =0 |
| virtual WideString | GetTagString () const =0 |
| virtual void | SetTag (UID newTag)=0 |
| virtual void | SetTag (const WideString &newTag)=0 |
| virtual UID | GetContentItem (LayoutSelector selector=kStandardLayout) const =0 |
| virtual void | SetContentItem (UID contentItem, LayoutSelector selector=kStandardLayout)=0 |
| virtual const XMLContentReference & | GetContentReference (void) const =0 |
| virtual void | SetContentReference (const XMLContentReference &contentReference)=0 |
| virtual ITextStoryThread * | QueryContentTextStoryThread (void) const =0 |
| virtual void | AddAttribute (const WideString &name, const WideString &value, bool16 removable=kTrue)=0 |
| virtual void | RemoveAttribute (const WideString &name)=0 |
| virtual void | SetAttributeName (const WideString &name, const WideString &newName)=0 |
| virtual void | SetAttributeValue (const WideString &name, const WideString &newValue)=0 |
| virtual int32 | GetAttributeCount () const =0 |
| virtual bool16 | HasAttribute (const WideString &name) const =0 |
| virtual WideString | GetAttributeNameAt (int32 pos) const =0 |
| virtual WideString | GetAttributeValue (const WideString &name) const =0 |
| virtual WideString | GetAttributeValueAt (int32 pos) const =0 |
| virtual bool16 | IsAttributeRemovable (const WideString &name) const =0 |
| virtual const_iterator | begin () const =0 |
| virtual const_iterator | end () const =0 |
| virtual const_iterator | make_iterator (int32 position) const =0 |
| virtual const_reverse_iterator | rbegin () const =0 |
| virtual const_reverse_iterator | rend () const =0 |
| virtual const_reverse_iterator | rmake_iterator (int32 position) const =0 |
| virtual void | GetInsertChildElementList (XMLDTDInsertElementList &childElementList) const =0 |
| virtual void | GetInsertSiblingAfterList (XMLDTDInsertElementList &siblingAfterList) const =0 |
| virtual void | GetReplaceElementList (XMLDTDReplaceElementList &replaceElementList) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
This interface is for elements on the logical structure tree; from client code- don't call mutators on this interface, instead use IXMLElementCommands, IXMLAttributeCommands etc.
See the element definition in XML 1.0 specification. An element will have at least a name (see IXMLTag), possibly some attributes and perhaps some content. The content and attributes if present are represented through this class.
There are methods that return iterators (of type XMLContentIterator) that can be used to iterate over the contents of an element in the order of the DOM. What these are doing is iterating over the children of a given XML element, not traversing the sub-tree.
Typedef for content iteration.
| typedef const value_type* IIDXMLElement::const_pointer |
Typedef for content iteration.
| typedef const value_type& IIDXMLElement::const_reference |
Typedef for content iteration.
| typedef K2Reverse_iterator<const_iterator, value_type, std::ptrdiff_t, const_pointer, const_reference> IIDXMLElement::const_reverse_iterator |
Typedef for content iteration.
Typedef for content iteration.
| typedef const value_type* IIDXMLElement::pointer |
Typedef for content iteration.
| typedef const value_type& IIDXMLElement::reference |
Typedef for content iteration.
| typedef K2Reverse_iterator<iterator, value_type, std::ptrdiff_t, pointer, reference> IIDXMLElement::reverse_iterator |
Typedef for content iteration.
Typedef for content iteration. When iterating the children of an element, the children can (perhaps) be characterised by text ranges; if you have an element within one story, say, section, with some dependents like 'title' and 'para' then these will lie within the text range of the parent, and each be characterised by a TextRange in the text model.
Index in parent constants, for AddChildAt() method
| pure virtual |
Add an attribute, optionally specifying that it can be removed later.
| name | identifies the attribute |
| value | initial value for this attribute |
| removable | if set to kTrue, then the attribute can't be removed by later calls (i.e. RemoveAttribute will fail) |
| pure virtual |
Mutator, to add child at given index.
| newChild | child to add |
| indexAt | specifies desired new index for child (or kEndIndex if no pref.) |
| setChildsParent | if kTrue, set the child's parent to point back to this |
| pure virtual |
Get iterator for iterating through children of this element
| pure virtual |
Get iterator for ending iteration (one of end of children)
| pure virtual |
Return the n'th child that has the specified tag applied.
| tag | name of the tag (IXMLTag) associated with this element |
| index | specifies index of child of interest |
| pure virtual |
Find index of child
| childToFind | persistent reference for child of interest |
| pure virtual |
Accessor for attribute count on this element
| pure virtual |
Accessor for attribute at given index
| pos | zero-based index in attribute list, 0 <= pos < GetAttributeCount() |
| pure virtual |
Accessor for attrib-value, given its name. NOTE: calling this method with an attribute name that does not exist on the element technically is an undefined operation, even though this method will return an empty WideString. In DEBUG, this method will fire an assert if it is called with an attribute that does not exist, although it is safe to continue. Please use HasAttribute() first to make sure the attribute exists.
| name | specifies attribute of interest |
| pure virtual |
Accessor for attribute at given index
| pos | zero-based index in attribute list, 0 <= pos < GetAttributeCount() |
| pure virtual |
Return the number of children this element has.
| pure virtual |
Return the item in layout where content will appear, if there is one.
| selector | identifies what layout content should appear in (param reserved for future use) |
| pure virtual |
Return the content reference associated with this element
| pure virtual |
get a list of first child elements the DTD will allow to insert
| childElementList | [OUT] receives the list of child elements the DTD will allow to insert for this element |
| pure virtual |
get a list of sibling after elements the DTD will allow to insert
| childElementList | [OUT] receives the list of sibling after elements the DTD will allow to insert |
| pure virtual |
Return the n'th child of the element; note that you can also use iterators rather than this mechanism
to iterate over the children. Index is zero-based index that should be in range [0..GetChildCount()-1]
| pure virtual |
Return the parent element.
| pure virtual |
get a list of possible replacement tags which the DTD will allow for this element
| replaceElementList | [OUT] receives the list of replacements tags the DTD will allow |
| pure virtual |
Accessor for tag-name of this element
| pure virtual |
| pure virtual |
Return a persistent reference (XMLReference) to this element.
| pure virtual |
Determine if this element has named attribute
| name | name of attribute |
| pure virtual |
Determine if attribute has been created as removable or not
| name | identifies attribute of interest |
| pure virtual |
Get forward iterator for iterating through children of this element starting at arbitrary position in the children list
| position | specifies location where the iterator should start from |
| pure virtual |
Query ITextStoryThread associated with the content, if applicable
| pure virtual |
Get iterator for backward iteration through children
| pure virtual |
Remove named attribute, unless added as non-removable; use IXMLElementCommands rather than this mutator from client code.
| name | identifies attribute to be removed |
| pure virtual |
Mutator; has the effect of removing given child,
| childToRemove | specifies child to remove |
| resetChild | if kTrue also sets the child's parent to invalid (i.e. kInvalidXMLReference). |
| pure virtual |
Remove child at given index
| indexAt | specifies zero based index of child to remove |
| resetChild | if kTrue also sets the child's parent to invalid (i.e. kInvalidXMLReference). |
| pure virtual |
Get iterator to mark end of backward iteration process
| pure virtual |
Make reverse iterator, for backward iteration from arbitrary position
| position | where iteration should start from |
| pure virtual |
Mutator for an attribute name; from client code, use IXMLAttributeCommands method from client code.
| name | specifies existing name for attribute of interest |
| newName | specifies the new name to change it to |
| pure virtual |
Mutator; for attribute value, but use IXMLAttributeCommands method from client code.
| name | identifies attribute of interest |
| newValue | specifies new value |
| pure virtual |
Mutator to set the specified child's XMLReference
| newChildXMLRef | specifies new child |
| indexAt | specifies index where child should be changed |
| pure virtual |
Mutator for content item associated with this element
| contentItem | |
| selector | default kStandardLayout (param reserved for future use) |
| pure virtual |
Mutator for content reference associated with this element
| contentReference | new content reference |
| pure virtual |
Mutator for the parent element (moves the element to a new location on the hierarchy);
use IXMLElementCommands::MoveElement instead from client code.
| newParent | specifies new parent element to set for this element |
| pure virtual |
Mutator for tagname of this element; use IXMLElementCommands::SetElement rather than this from client code. Uses an IXMLTag, created perhaps with IXMLTagCommands method.
| newTag | specifies UID of an IXMLTag that contains new name for this element |
| pure virtual |
Mutator for tagname, but use IXMLElementCommands::SetElement rather than this from client code.
| newTag | specifies new tagname to set for this element |
| pure virtual |
Mutator to set a new persistent reference (XMLReference) for this element.
| newXMLRef | specifies the reference for this element. |