InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXMLUtils Class Referenceabstract

#include <IXMLUtils.h>

Inheritance diagram for IXMLUtils:
IPMUnknown

Classes

class  IXMLCallback
 

Public Types

enum  { kDefaultIID = IID_IXMLUTILS }
 
enum  CalcXMLParent_Result { kSuccessCalc = 0, kStartUnmatched = 1, kEndUnmatched = 2, kBothUnmatched = kStartUnmatched+kEndUnmatched }
 

Public Member Functions

virtual UIDRef GetBackingStore (IDocument *doc)=0
 
virtual UIDRef GetBackingStore (IDataBase *db)=0
 
virtual IIDXMLElementQueryDocElement (IDocument *document)=0
 
virtual IIDXMLElementQueryDocElement (IDataBase *db)=0
 
virtual IIDXMLElementQueryRootElement (IIDXMLElement *xmlDocElement)=0
 
virtual IIDXMLElementQueryRootElement (IDocument *document)=0
 
virtual IIDXMLElementQueryRootElement (IDataBase *db)=0
 
virtual IXMLTagListQueryXMLTagList (IDataBase *db)=0
 
virtual IXMLStyleToTagMapQueryXMLStyleToTagMap (IDataBase *db)=0
 
virtual IXMLTagToStyleMapQueryXMLTagToStyleMap (IDataBase *db)=0
 
virtual ITextModelQueryTextModel (const IIDXMLElement *element)=0
 
virtual IXMLReferenceDataQueryXMLReferenceData (IPMUnknown *item, bool16 allowTOP=kFalse)=0
 
virtual IXMLReferenceDataQueryXMLReferenceData (const UIDRef &item, bool16 allowTOP=kFalse)=0
 
virtual IXMLReferenceDataQueryXMLReferenceData (const UIDRef &storyUIDRef, TextIndex textIndex, bool16 allowTOP=kFalse)=0
 
virtual IXMLReferenceDataQueryXMLReferenceData (ITextModel *textModel, TextIndex textIndex, bool16 allowTOP=kFalse)=0
 
virtual IXMLReferenceDataQueryXMLReferenceData (const XMLReference &xmlReference)=0
 
virtual bool16 GetElementIndices (const IIDXMLElement *element, TextIndex *startPos, TextIndex *endPos)=0
 
virtual void GetElementMarkerPositions (IIDXMLElement *element, TextIndex *startPos, TextIndex *endPos)=0
 
virtual bool16 CalculateStartEndTextIndex (IIDXMLElement *element, int32 beforeChildIndex, TextIndex &startTextIndex, TextIndex &endTextIndex)=0
 
virtual ErrorCode UpdateAutoAttrib (const XMLReference &ref)=0
 
virtual XMLReference GetStoryXMLReference (const UIDRef &storyRef)=0
 
virtual XMLReference GetStoryThreadXMLReference (const UIDRef &storyUIDRef, TextIndex textIndex)=0
 
virtual XMLReference GetStoryThreadXMLReference (ITextModel *textModel, TextIndex textIndex)=0
 
virtual int32 CalcXMLParent (XMLReference &startParentXMLRef, int32 &startIndexInParent, K2Vector< XMLReference > &childRefList, XMLReference &endParentXMLRef, int32 &endIndexInParent, TextIndex startTextIndex, TextIndex endTextIndex, ITextModel *iTextModel, bool16 useReverseSearch=kTrue)=0
 
virtual void CalcXMLElementsInTextRange (ITextModel *iTextModel, TextIndex startTextIndex, TextIndex endTextIndex, XMLReference &parentXMLRef, K2Vector< XMLReference > &childRefList)=0
 
virtual ErrorCode AssignTagUID (const WideString &strTag, IDataBase *db, UID colorUID, UID &tagUID)=0
 
virtual bool16 IsTagValid (const WideString &tag)=0
 
virtual bool16 IsNmtoken (const PMString &token)=0
 
virtual bool16 IsValidXMLComment (const PMString &comment)=0
 
virtual bool16 IsValidXMLPITarget (const PMString &piTarget)=0
 
virtual bool16 IsValidXMLPIData (const PMString &piData)=0
 
virtual bool16 IsTaggablePageItem (IPMUnknown *item)=0
 
virtual void FindUnusedTags (UIDList &unusedTag)=0
 
virtual UID ImportHREF (IDataBase *db, const PMString &href, const IDFile *relativeTo, bool16 &useFrame, UIFlags uiFlags=kFullUI)=0
 
virtual bool16 IsElementLocked (const IIDXMLElement *element)=0
 
virtual bool16 IsStoryLocked (const UIDRef &storyRef)=0
 
virtual bool HasUnlockedStory (IDataBase *db)=0
 
virtual bool16 LinkElementInTextRange (const UIDRef &storyUIDRef, TextIndex start, int32 numChars)=0
 
virtual UID GetGraphicFrame (const UIDRef &contentUID)=0
 
virtual bool16 IsElementAGraphic (IIDXMLElement *element) const =0
 
virtual bool16 GetActualContent (UIDRef &contentRef)=0
 
virtual void ValidateXML (const XMLReference &startXMLRef, K2Vector< XMLDTDValidationError > &errors, int32 maxErrors=250, bool16 treatAsRoot=kFalse, bool16 checkHasDTD=kFalse)=0
 
virtual ErrorCode ExportElement (IIDXMLElement *element, bool16 includeHeader, IXMLAccess *access, IXMLHandler *exportHandler, const IDFile &sysFile, IDocument *doc, const PMString &formatName, UIFlags uiFlags) const =0
 
virtual void ExportDTDToStream (const XMLReference &xmlRef, IXMLOutStream *s, bool16 internalSubsetOnly=kFalse)=0
 
virtual bool16 IsExportableInCopyStory (const UIDRef &storyUIDRef)=0
 
virtual bool16 FindMissingFile (PMString filename, IDFile &fileToImport)=0
 
virtual XMLReference GetImportedRootXMLReference (IPMUnknown *importer)=0
 
virtual void ForEachElement (IIDXMLElement *root, IXMLCallback *callback)=0
 
virtual bool16 IsParentCellWithType (IIDXMLElement *childElement, CellType cellType)=0
 
virtual ErrorCode SetShouldDeleteElementOnContentDeletion (const bool16 shouldDelete=kTrue) const =0
 
virtual bool16 ShouldDeleteElementOnContentDeletion () const =0
 
virtual ErrorCode SetLayoutTag (const UIDList &itemList, const UIDRef &tag, bool16 retag, bool16 allowPresetUI)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Utilities for traversing and working within the logical structure tree.

Member Enumeration Documentation

Enumeration containing return values for CalcXMLParent()

Member Function Documentation

virtual ErrorCode IXMLUtils::AssignTagUID (const WideStringstrTag,
IDataBasedb,
UID colorUID,
UIDtagUID 
)
pure virtual

Create a new tag (IXMLTag) in the tag-list (IXMLTagList).

Parameters
strTagspecifies the tag-name to use
dbidentifies the database, into whose tag-list the new tag is inserted
colorUIDcontains the UID of the color to use for the tag (kInvalidUID if you don't care)
tagUIDcontains the UID of the newly created tag or kInvalidUID if unsuccessful.
Returns
ErrorCode
virtual bool16 IXMLUtils::CalculateStartEndTextIndex (IIDXMLElementelement,
int32 beforeChildIndex,
TextIndex & startTextIndex,
TextIndex & endTextIndex 
)
pure virtual

Calculate the range of text before/after/in between child objects per the XML structure. Used when generating chunks of XML content.

Parameters
elementspecifies XML element of interest
beforeChildIndexspecifies the indicies to be calculated are BEFORE this child (to get the indices after the last child pass the last child index + 1)
startPos[OUT] start of text-range before specified child
endPos[OUT] end of text-range before specified child
Returns
bool16 kFalse if there is no XML content for the specified element before the specified child
virtual void IXMLUtils::CalcXMLElementsInTextRange (ITextModeliTextModel,
TextIndex startTextIndex,
TextIndex endTextIndex,
XMLReferenceparentXMLRef,
K2Vector< XMLReference > & childRefList 
)
pure virtual

Given a text range, calculate a list of top-level XML elements that are fully contained in the range. Elements that are partially inside the range are not included in the list. startTextIndex and endTextIndex must be in the same story thread.

[IN] text model of the range @ startTextIndex [IN] TextIndex to start the calculation @ endTextIndex [IN] TextIndex to stop the calculation (INCLUSIVE, this means range of 3,3 is actually one character; 3,2 signifies an insertion position) @ parentXMLRef [OUT] the parent of the elements in chilRefList @ childRefList [OUT] a list of top-level children in the text range

virtual int32 IXMLUtils::CalcXMLParent (XMLReferencestartParentXMLRef,
int32 & startIndexInParent,
K2Vector< XMLReference > & childRefList,
XMLReferenceendParentXMLRef,
int32 & endIndexInParent,
TextIndex startTextIndex,
TextIndex endTextIndex,
ITextModeliTextModel,
bool16 useReverseSearch = kTrue 
)
pure virtual

Perform the element calculations as if the given text range is to be tagged. Given a text range, determine the XML element (given as XMLReference) that should be the parent (along with the child index) of the selection. Also calculates a list of children of the final parent that should become the children of the created element

Parameters
startParentXMLRefparent XML element to start the calculation. Receives the XML element that should be the parent of the selection. If the result is not kSuccessCalc, receives the parent of startTextIndex
startIndexInParentreceives the child index of startParentXMLRef the selection should be inserted as
childRefLista list of children of startParentXMLRef that should become children of the new XML element. Valid on return only if returned result code is kSuccessCalc
endParentXMLRefif the result is not kSuccessCalc, receives the parent of endTextIndex. Valid on return only if returned result code is not kSuccessCalc
endIndexInParentif the result is not kSuccessCalc, receives the child index of endParentXMLRef. Valid on return only if returned result code is not kSuccessCalc
startTextIndexTextIndex to start the calculation
endTextIndexTextIndex to stop the calculation (INCLUSIVE, this means range of 3,3 is actually one character; 3,2 signifies an insertion position)
iTextModeltext model of text to insert
useReverseSearchUsually, this method searches the child elements in the reverse order, from back to front. This is to optimize for the case of repeated append operations, such as when building XML structure during import using the parsed order to create elements. Reverse search is faster in this case because most of the desired data is at the end of the child list. Set this parameter to kFalse will cause the search to be done in the front to back order. This search order can be faster for cases such as building the structure in the reverse order, where most of the desired data is at the front of the child list
Returns
CalcXMLParent_Result code
virtual void IXMLUtils::ExportDTDToStream (const XMLReferencexmlRef,
IXMLOutStreams,
bool16 internalSubsetOnly = kFalse 
)
pure virtual

Export the DTD to the given stream.

Parameters
xmlRefXMLReference of any element in the XML to export the DTD from
sstream to export to
internalSubsetOnlywhether to write internal subset only
virtual ErrorCode IXMLUtils::ExportElement (IIDXMLElementelement,
bool16 includeHeader,
IXMLAccessaccess,
IXMLHandlerexportHandler,
const IDFilesysFile,
IDocumentdoc,
const PMStringformatName,
UIFlags uiFlags 
) const
pure virtual

Export an XML element and its children to a stream

Parameters
elementspecifies the element to export
includeHeaderInclude the DTD in the XML?
accessused to navigate and export the sub-elements
exportHandlercontains the stream to write to
sysFilethe actual file we are writing to
docdocument we are writing the XML from
Returns
ErrorCode Did theexport work?
virtual bool16 IXMLUtils::FindMissingFile (PMString filename,
IDFilefileToImport 
)
pure virtual

Allow the user to find a missing file referenced in the XML. In the server case log an error to the error list

Parameters
filenamestring that describes the file name in the XML
fileToImportstring that returns the file name that was selected
Returns
bool16 whether the file was found or not
virtual void IXMLUtils::FindUnusedTags (UIDListunusedTag)
pure virtual

Given an open document, return which are not used to mark-up content in the document.

Parameters
unusedTag[OUT] list of tags not marking up content in document implied by its database. Note that the database of the UIDList supplied should be the database of the document containing the tags that the query is about.
virtual void IXMLUtils::ForEachElement (IIDXMLElementroot,
IXMLCallbackcallback 
)
pure virtual

Iterate a portion of the XML tree, using the supplied element as the root of a sub-tree. Will call into the callback object for each element in the sub-tree. Uses a non-recursive algorithm so it works with deep trees.

Parameters
rootThe root of the elements to iterate.
callbackThe object to callback for each element Returns kInvalidXMLReference if no root element is found.
virtual bool16 IXMLUtils::GetActualContent (UIDRefcontentRef)
pure virtual

Return the taggable content UIDRef that's associated with the incoming UID. Returns true if the item can be tagged. Returns a valid contentRef if there is content that can be immediately tagged. A return value of kTrue, together with an invalid contentRef shows that item can be tagged if placeholder content can be added.

If caller passed in a graphic frame, this method will return the taggable content from the graphic frame. If it is a text frame, will return the story.

If its a graphic frame, and it has content, this method will tunnel down to the children to find taggable content. If the frame has content, but the content isn't taggable, this method would flag an error by returning kFalse

Parameters
contentRef[OUT] holds the content item if it can be found
Returns
bool16 indicating success of operation(if kTrue) or failure (kFalse)
virtual bool16 IXMLUtils::GetElementIndices (const IIDXMLElementelement,
TextIndex * startPos,
TextIndex * endPos 
)
pure virtual

Get the positions of the marker characters for the given element returns kTrue if the positions are marker positions; kFalse if content position (i.e. story element which does not have markers)

Parameters
elementspecifies element of interest
startPos[OUT] TextIndex where the begin-element marker tag is located in the textflow
endPos[OUT] TextIndex where the end-element marker tag is located in the textflow
Returns
bool16 kTrue if positions are marker positions, kFalse if content positions and the story element does not have markers in it
virtual void IXMLUtils::GetElementMarkerPositions (IIDXMLElementelement,
TextIndex * startPos,
TextIndex * endPos 
)
pure virtual

Get the actual positions of the marker characters for the given element. The values returned are always marker positions in the story that contains the markers, which is not always the content's story (such as link elements)

Parameters
elementspecifies XML element of interest
startPos[OUT] start of text-range tagged by this element
endPos[OUT] end of text-range tagged by this element
virtual UID IXMLUtils::GetGraphicFrame (const UIDRefcontentUID)
pure virtual

Returns the graphic frame that contains the content. If the content is a text model, it returns the graphic frame that contains the multi-column frame. If the content is a page item, it returns the graphic frame that contains the page item.

Parameters
contentUIDspecifies the content item that we're interested in
Returns
UID of graphic frame containing the content, which can be kInvalidUID if the content isn't placed into a story yet
virtual XMLReference IXMLUtils::GetImportedRootXMLReference (IPMUnknownimporter)
pure virtual

Returns the the root element of the imported XML data.

Parameters
importerAn interface on kXMLImporterBoss. Must not be nil.
Returns
XMLReference The XMLReference of the roort element. Returns kInvalidXMLReference if no root element is found.
virtual XMLReference IXMLUtils::GetStoryThreadXMLReference (const UIDRefstoryUIDRef,
TextIndex textIndex 
)
pure virtual

Returns the XMLReference corresponding to the given text position's story thread

Parameters
storyUIDRefUIDRef of the story
textIndexTextIndex of the text position
Returns
XMLReference of the given text position's story thread
virtual XMLReference IXMLUtils::GetStoryThreadXMLReference (ITextModeltextModel,
TextIndex textIndex 
)
pure virtual

Returns the XMLReference corresponding to the given text position's story thread

Parameters
textModelTextModel of the story
textIndexTextIndex of the text position
Returns
XMLReference of the given text position's story thread
virtual XMLReference IXMLUtils::GetStoryXMLReference (const UIDRefstoryRef)
pure virtual

Return the XMLReference that corresponds to the story. In the case the story is the backing store (unplaced content), the XML document's XMLReference is returned

Parameters
storyRefspecifies the story of interest
Returns
XMLReference to story corresponding to given XMLReference
virtual bool IXMLUtils::HasUnlockedStory (IDataBasedb)
pure virtual

Returns true if the database contains unlocked stories

Parameters
inIDatabase current database
virtual UID IXMLUtils::ImportHREF (IDataBasedb,
const PMStringhref,
const IDFilerelativeTo,
bool16 & useFrame,
UIFlags uiFlags = kFullUI 
)
pure virtual

Import a page item into the given database using the 'href' passed in as the path to the file. Note that this doesn't imply that the content will be loaded across the wire; it is strictly a path in the local file system at the time of writing.

Parameters
dbdatabase to import the page item into
hrefa string which represents the path to the file you want to import
relativeToif passed in (it can be nil), the href passed in will be used as a relative path with respect to 'relativeTo' if 'relativeTo' is a directory, the path will stem from it, if 'relativeTo' is a file, the path will stem from it's parent directory
useFrame[OUT] parameter
uiFlagsspecifies how much UI to show
Returns
UID of the page item created
virtual bool16 IXMLUtils::IsElementAGraphic (IIDXMLElementelement) const
pure virtual

Determine if we consider the element to be a graphic element. If it has an href and no content or children, then we consider it a graphic

Parameters
elementspecifies element of interest
Returns
bool16 kTrue if a graphic element,kFalse otherwise
virtual bool16 IXMLUtils::IsElementLocked (const IIDXMLElementelement)
pure virtual
Checks to see if the content is locked given the element via ITextLockData on given element.

Parameters
elementspecifies element of interest
Returns
bool16 kTrue if locked and kFalse otherwise
virtual bool16 IXMLUtils::IsExportableInCopyStory (const UIDRefstoryUIDRef)
pure virtual

determine whether the given story is exportable as an InCopy story from XML's perspective

Parameters
storyUIDRefUIDRef of story to export
Returns
bool16 kTrue if the story is exportable as InCopy story; kFalse otherwise
virtual bool16 IXMLUtils::IsNmtoken (const PMStringtoken)
pure virtual

Determine whether the given token matched XML 1.0 specification's (REC-xml-20001060) production for [7] Nmtoken

Parameters
tokentoken to check
Returns
bool16 kTrue if the token is a Nmtoken; kFalse otherwise
virtual bool16 IXMLUtils::IsParentCellWithType (IIDXMLElementchildElement,
CellType cellType 
)
pure virtual

Checks whether the Parent of the Passed element is Table-Cell With CellType being equal to the passed CellType like kPageItemContentType, kTextContentType etc

Parameters
childElementThe element whose Parent we need to check, if parent is not Table-Cell then returns kFalse
cellTypeThe cellType of the Parent of element which is Table-Cell is also matched if the Parent is Table-Cell. Returns kTrue if Parent is Table-Cell and CellType also matches the passed cellType.
virtual bool16 IXMLUtils::IsStoryLocked (const UIDRefstoryRef)
pure virtual
Checks to see if the content is locked given the story

NOTE: now it works for generic page items too, not just stories

Parameters
storyRefspecifies story of interest
Returns
bool16 kTrue if story locked, kFalse otherwise
virtual bool16 IXMLUtils::IsTaggablePageItem (IPMUnknownitem)
pure virtual

Determine if given boss object could be marked-up. If this item or a child down the hierarchy has an IXMLReferenceData IFace, it is it can be marked-up (is taggable). Alternatively if this item is a graphic frame, it can be marked-up (is taggable). If this item is a group or a guide it cannot be marked-up (is not taggable)

Parameters
iteminterface on boss object (page item) of interest
Returns
bool16 kTrue if the page item can be marked up, kFalse otherwise
virtual bool16 IXMLUtils::IsTagValid (const WideStringtag)
pure virtual

Checks to see if a given tag-name would be appropriate as the name for an XML element (not whether tag already exists as that would imply a database). Determines in order;

  1. if the tag is empty
  2. if there are whitespace characters in the name
  3. If there are 'illegal' characters; see XML 1.0 specification

For instance, names for an XML element can only begin with an alphabetic character or an underline, or a colon.

Parameters
tagname of tag to check
Returns
bool16 kTrue if can be used for tag-name, kFalse otherwise
virtual bool16 IXMLUtils::IsValidXMLComment (const PMStringcomment)
pure virtual

Determine whether the given comment is a valid XML comment per XML 1.0 specification (REC-xml-20001006), section 2.5

Parameters
commentcomment to check
Returns
bool16 kTrue if the comment is valid; kFalse otherwise
virtual bool16 IXMLUtils::IsValidXMLPIData (const PMStringpiData)
pure virtual

Determine whether the given string is a valid XML processing instruction data per XML 1.0 specification (REC-xml-20001006), section 2.6

Parameters
piDataPI data to check
Returns
bool16 kTrue if piData is a valid PI data; kFalse otherwise
virtual bool16 IXMLUtils::IsValidXMLPITarget (const PMStringpiTarget)
pure virtual

Determine whether the given string is a valid XML processing instruction target per XML 1.0 specification (REC-xml-20001006), section 2.6

Parameters
piTargetPI target to check
Returns
bool16 kTrue if piTarget is a valid PI target; kFalse otherwise
virtual bool16 IXMLUtils::LinkElementInTextRange (const UIDRefstoryUIDRef,
TextIndex start,
int32 numChars 
)
pure virtual

Determines whether there are any link elements in the given text range.

Parameters
storyUIDRefspecifies story of interest
startwhere to start looking for link elements
numCharshow many chars forward in the textmodel to search
Returns
kTrue if the text range contains at least one link XML element; kFalse otherwise
virtual IIDXMLElement* IXMLUtils::QueryDocElement (IDocumentdocument)
pure virtual

Return the XML document element for the given document

Parameters
documentspecifies document of interest
Returns
IIDXMLElement interface ptr that has its reference-count incremented
virtual IIDXMLElement* IXMLUtils::QueryDocElement (IDataBasedb)
pure virtual

Return the XML document element for the given database, based on the database' document

Parameters
dbspecifies database of interest
Returns
IIDXMLElement interface ptr that has its reference-count incremented
virtual IIDXMLElement* IXMLUtils::QueryRootElement (IIDXMLElementxmlDocElement)
pure virtual

Return the root element of the given XML document element

Parameters
xmlDocElementXML document element of interest
Returns
IIDXMLElement interface ptr that has its reference-count incremented
virtual IIDXMLElement* IXMLUtils::QueryRootElement (IDocumentdocument)
pure virtual

Return the root element of the given document

Parameters
documentspecifies document of interest
Returns
IIDXMLElement interface ptr that has its reference-count incremented to the root XML element
virtual IIDXMLElement* IXMLUtils::QueryRootElement (IDataBasedb)
pure virtual

Return the root element of the given database (based on the db's document)

Parameters
dbdatabase from document
Returns
IIDXMLElement interface ptr that has its reference-count incremented to the root element
virtual ITextModel* IXMLUtils::QueryTextModel (const IIDXMLElementelement)
pure virtual

Query for the text model associated with given element.

Parameters
elementspecifies element of interest. Note that element->GetContentItem() should be a valid UID.
Returns
ITextModel interface ptr that has its reference-count incremented
virtual IXMLReferenceData* IXMLUtils::QueryXMLReferenceData (IPMUnknownitem,
bool16 allowTOP = kFalse 
)
pure virtual

Given any interface on an arbitrary boss object, determine if there is XML data associated with it's content. This method checks the contents of frames in the following order;

  1. a text on a path frame
  2. a text frame
  3. a graphic frame

It will try to return an IXMLReferenceData given knowledge about the model format.

Parameters
itemspecifies the boss object of interest (frame of some kind)
allowTOPset to be kTrue if text on path frames are allowable, kFalse otherwise
Returns
IXMLReferenceData interface ptr that has its reference-count incremented for the content of the frame
virtual IXMLReferenceData* IXMLUtils::QueryXMLReferenceData (const UIDRefitem,
bool16 allowTOP = kFalse 
)
pure virtual

Overload of method QueryXMLReferenceData, given a persistent reference rather than an interface ptr.

Parameters
itemspecifies frame of interest
allowTOPkTrue if text on path frames are allowable, kFalse otherwise
Returns
IXMLReferenceData interface ptr that has its reference-count incremented
virtual IXMLReferenceData* IXMLUtils::QueryXMLReferenceData (const UIDRefstoryUIDRef,
TextIndex textIndex,
bool16 allowTOP = kFalse 
)
pure virtual

Given a text index position, return the IXMLReferenceData associated with the text index.

Parameters
storyUIDRefUIDRef of the story the text index is in
textIndexTextIndex to query IXMLReferenceData for
allowTOPkTrue if text on path frames are allowable, kFalse otherwise
Returns
IXMLReferenceData interface ptr that has its reference-count incremented
virtual IXMLReferenceData* IXMLUtils::QueryXMLReferenceData (ITextModeltextModel,
TextIndex textIndex,
bool16 allowTOP = kFalse 
)
pure virtual

Given a text index position, return the IXMLReferenceData associated with the text index.

Parameters
textModelTextModel of the story the text index is in
textIndexTextIndex to query IXMLReferenceData for
allowTOPkTrue if text on path frames are allowable, kFalse otherwise
Returns
IXMLReferenceData interface ptr that has its reference-count incremented
virtual IXMLReferenceData* IXMLUtils::QueryXMLReferenceData (const XMLReferencexmlReference)
pure virtual

Given a XMLReference, return the IXMLReferenceData associated with the element's content, if applicable

Parameters
xmlReferenceXMLReference of the element to process
Returns
IXMLReferenceData interfaceptr that has its reference-count incremeneted, if the element has such content. nil otherwise
virtual IXMLStyleToTagMap* IXMLUtils::QueryXMLStyleToTagMap (IDataBasedb)
pure virtual

Query for the mapping between paragraph/character styles and tags in the given databse.

Parameters
dbspecifies database of interest
Returns
IXMLStyleToTagMap interface ptr that has its reference-count incremented
virtual IXMLTagList* IXMLUtils::QueryXMLTagList (IDataBasedb)
pure virtual

Query for the tag-list in the given database.

Parameters
dbdatabase containing tag-list of interest
Returns
IXMLTagList interface ptr that has its reference-count incremented
virtual IXMLTagToStyleMap* IXMLUtils::QueryXMLTagToStyleMap (IDataBasedb)
pure virtual

Query for the mapping between tag-names and paragraph/character styles in the given database.

Parameters
dbdatabase containing mapping of interest
Returns
IXMLTagToStyleMap interface ptr that has its reference-count incremented, for given database
virtual ErrorCode IXMLUtils::SetLayoutTag (const UIDListitemList,
const UIDReftag,
bool16 retag,
bool16 allowPresetUI 
)
pure virtual
Set the tag for a layout item (page item)

Parameters
target- The target to use when tagging the object
tag- The UIDRef of the tag you want to use
retag- Whether to retag an existing element with a new tag
allowPresetUI- Allow the tagging preset UI to popup
Returns
- Whether the method succeeded or not
virtual ErrorCode IXMLUtils::SetShouldDeleteElementOnContentDeletion (const bool16 shouldDelete = kTrue) const
pure virtual

Sets the preference to also delete the XML element when its content has been deleted. Default is kFalse.

virtual bool16 IXMLUtils::ShouldDeleteElementOnContentDeletion () const
pure virtual

Gets the value for preference to also delete the XML element when its content has been deleted.

See Also
IXMLUtils::SetShouldDeleteElementOnContentDeletion.
virtual ErrorCode IXMLUtils::UpdateAutoAttrib (const XMLReferenceref)
pure virtual

Automatic attributes are at present 'href'. If the element associated with the given XMLReference is a graphic item, then at the time of writing (InDesign 2.0) it will automatically get an href attribute added to it.

Parameters
ref
Returns
ErrorCode
virtual void IXMLUtils::ValidateXML (const XMLReferencestartXMLRef,
K2Vector< XMLDTDValidationError > & errors,
int32 maxErrors = 250,
bool16 treatAsRoot = kFalse,
bool16 checkHasDTD = kFalse 
)
pure virtual

Validate the XML against a DTD.

Parameters
startXMLRefXMLReference of the element to start the validation at. Use the document element to validate the entire XML
errors[OUT] receives vector of validation errors found
See Also
XMLDTDValidationError
Parameters
maxErrorsmaximum number of errors to retrieve. Use -1 to get all the errors
treatAsRootif startXMLRef is not the document element or the root element, whether to check startXMLRef against DOCTYPE root element type. This is used when validating from something other than the root, but still wants to treat the starting element as root
checkHasDTDif startXMLRef has no DTD reference, whether it should be flagged as an error. Set this flag to kFalse, and XML without DTD will also "pass" the validation