|
| | SnpManipulateXMLElements () |
| |
| virtual | ~SnpManipulateXMLElements () |
| |
| XMLReference | GetDocumentElementRef (const UIDRef &documentUIDRef) |
| |
| void | GetFlattenedElementList (const UIDRef &documentUIDRef, K2Vector< XMLReference > &outElems) |
| |
| XMLReference | GetRootElementRef (const UIDRef &documentUIDRef) |
| |
| ErrorCode | CreateElements (const XMLReference &parentXMLReference, const PMString &tagName, int32 numElements, K2Vector< XMLReference > &outElementsCreated) |
| |
| ErrorCode | CreateAttributes (const K2Vector< XMLReference > &elements, const PMString &attribName, const PMString &attribValue) |
| |
| ErrorCode | CreateComment (const XMLReference &parentXMLReference, const PMString &commentText, XMLReference &outXMLReferenceCreated) |
| |
| ErrorCode | CreateProcessingInstruction (const XMLReference &parentXMLReference, const PMString &piKey, const PMString &piValue, XMLReference &outXMLReferenceCreated) |
| |
| ErrorCode | ModifyComment (const XMLReference &commentXMLReference, const PMString &newCommentText) |
| |
| ErrorCode | ModifyProcessingInstruction (const XMLReference &piXMLReference, const PMString &newPiKey, const PMString &newPiValue) |
| |
| ErrorCode | TagGraphic (const PMString &tagName, const UIDRef &graphicFrameUIDRef) |
| |
| ErrorCode | TagStoryThroughFrame (const PMString &tagName, const UIDRef &textFrameContainerUIDRef) |
| |
| ErrorCode | TagStory (const PMString &tagName, const UIDRef &textModelUIDRef) |
| |
| ErrorCode | TagTable (const UIDRef &tableModelUIDRef, const PMString &tableTagName, const PMString &cellTagName, XMLReference &outCreatedXMLReference) |
| |
| ErrorCode | TagTextRange (const UIDRef &textModelUIDRef, const PMString &tagName, const TextIndex &startIndex, const TextIndex &endIndex) |
| |
| void | ValidateFromRoot (IActiveContext *context) |
| |
| void | ValidateFromElement (const XMLReference &xmlRef) |
| |
- How to obtain list of all elements
- How to obtain reference to root or document element
- How to associate a DTD with the logical structure
- How to create elements in the logical structure
- How to create XML comments and processing instructions
- How to modify comments and processing instructions
- How to tag a graphic frame (IGraphicFrameData) for instance as image placeholder
- How to tag a story (kTextStoryBoss)
- how to tag a table (kTableModelBoss)
- How to tag a text range
- How to validate logical structure against a DTD
Once you have run the snippet options, an interesting thing to do is try using SnpInspectSelectionXMLProperties to find out something about what has been created. For instance, if you run TagGraphic, select the frame in the layout view and run SnpInspectSelectionXMLProperties.
Exercising
AcquireElements
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option AcquireElements.
- If all is well, there should be no asserts (if in debug build).
AssociateDTD
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option AssociateDTD.
- If all is well, there should be no asserts (if in debug build).
CreateElementsAndAttributes
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option CreateElementsAndAttributes.
- If all is well, there should be no asserts (if in debug build).
- You should see some elements with attributes in the logical structure
CreateComment/PI
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option CreateComment/PI.
- If all is well, there should be no asserts (if in debug build).
- You should see some new comment/PI in logical structure
ModifyComment/PI
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option ModifyComment/PI.
- If all is well, there should be no asserts (if in debug build).
- You should see comment/PI in logical structure created, which was the thing modified
TagGraphic
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option TagGraphic.
- If all is well, there should be no asserts (if in debug build).
- You should see a placeholder graphic created and tagged
TagStory
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option TagStory.
- If all is well, there should be no asserts (if in debug build).
TagTable
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option TagTable.
- If all is well, there should be no asserts (if in debug build).
TagTextRange
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option TagTextRange.
- If all is well, there should be no asserts (if in debug build).
ValidateAgainstDTD
- Create a new document
- Run the snippet ManipulateXMLElements
- Choose the option ValidateAgainstDTD.
- If all is well, there should be no asserts (if in debug build).
- See Also
- _SnpRunnerManipulateXMLElements::Run for driver code