InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpManipulateXMLSelection Class Reference

Public Member Functions

ErrorCode CreateAttributesInSelection (ISelectionManager *selectionManager, const PMString &attribName, const PMString &attribValue)
 
ErrorCode CreateCommentInSelection (ISelectionManager *selectionManager, const PMString &commentText)
 
ErrorCode CreateElementsInSelection (ISelectionManager *selectionManager, const UIDRef &tagUIDRef, int32 numElements)
 
ErrorCode CreateProcessingInstructionInSelection (ISelectionManager *selectionManager, const PMString &piKey, const PMString &piValue)
 
ErrorCode ExportXMLSnippetFromSelection (ISelectionManager *selectionManager, const IDFile &targetFile)
 
ErrorCode ExportFromSelection (ISelectionManager *selectionManager, const IDFile &targetFile)
 
ErrorCode ImportIntoSelection (ISelectionManager *selectionManager, IDataBase *database, const IDFile &targetFile)
 
ErrorCode ValidateFromSelection (ISelectionManager *selectionManager, IXMLValidator *xmlValidator)
 

Detailed Description

Manipulates properties of an XML selection, nodes selected in the structure view.

Member Function Documentation

ErrorCode SnpManipulateXMLSelection::CreateAttributesInSelection (ISelectionManagerselectionManager,
const PMStringattribName,
const PMStringattribValue 
)

Attempt to create attributes for selected node(s)

Parameters
selectionManagerreference to the abstract selection
attribNamename of attribute
attribValuevalue to assign to newly created attribute
Returns
ErrorCode kSuccess on success, kFailure otherwise
ErrorCode SnpManipulateXMLSelection::CreateCommentInSelection (ISelectionManagerselectionManager,
const PMStringcommentText 
)

Attempt to create a comment (kXMLCommentBoss) parented by selected node(s)

Parameters
selectionManagerreference to the abstract selection
commentText
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise
ErrorCode SnpManipulateXMLSelection::CreateElementsInSelection (ISelectionManagerselectionManager,
const UIDReftagUIDRef,
int32 numElements 
)
Attempt to create elements  parented by selected node(s)

Parameters
selectionManagerreference to the abstract selection
tagUIDRef
numElements
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise
ErrorCode SnpManipulateXMLSelection::CreateProcessingInstructionInSelection (ISelectionManagerselectionManager,
const PMStringpiKey,
const PMStringpiValue 
)
Attempt to create a processing instruction parented by selected node(s)

Parameters
selectionManagerreference to the abstract selection
piKey
piValue
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise
ErrorCode SnpManipulateXMLSelection::ExportFromSelection (ISelectionManagerselectionManager,
const IDFiletargetFile 
)

Export selected node(s) as XML

Parameters
selectionManagerreference to the abstract selection
targetFile
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise
ErrorCode SnpManipulateXMLSelection::ExportXMLSnippetFromSelection (ISelectionManagerselectionManager,
const IDFiletargetFile 
)
Export the selected node(s) as Snippet

Parameters
selectionManagerreference to the abstract selection
targetFile
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise
ErrorCode SnpManipulateXMLSelection::ImportIntoSelection (ISelectionManagerselectionManager,
IDataBasedatabase,
const IDFiletargetFile 
)

Attempt to import specified XML data file into logical structure to be parented by selected node. If multiple nodes selected, then top level element(s) in imported content becomes peers of selected nodes.

Parameters
selectionManagerreference to the abstract selection
databasedocument's database into which to import (NB: the API used is slightly at variance with abstract selection model)
targetFile
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise
ErrorCode SnpManipulateXMLSelection::ValidateFromSelection (ISelectionManagerselectionManager,
IXMLValidatorxmlValidator 
)

Attempt to validate selected node(s) against associated DTD

Precondition
DTD must be associated with doc
Parameters
selectionManagerreference to the abstract selection
xmlValidator(NB: the API used is slightly at variance with abstract selection model)
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise