Coding the Smart Document

Now that you have the XML foundation laid, it’s time to integrate the data with code for manipulating it.

Required Document Actions

For our Smart Document solution, several actions will be required:

  • Apply markup and style to inline components (superscript, subscript, bold, italic, underscore, and code).

  • Insert block-level components (paragraphs, code blocks, lists, notes, and warnings).

  • Insert additional entries into lists.

  • Insert boilerplate warnings.

  • Add a graphic.

  • Create a hyperlink to a specific location.

Each action will contain a caption, a description, and help information for the end user. Upon selection, the appropriate markup will be inserted and styles applied. Pay careful attention to the Notes and Warnings; Microsoft Word, in this first release of Smart Document functionality, doesn’t always behave as expected.

Tip

In general, beware of the cursor location. The values returned by your code may not be what you anticipated; this might be due to the current setting of the tag display.

Also, paragraph styles can only be applied to objects that look like a paragraph. If your markup runs in with another style, it will either inherit the current style characteristics or change the entire block to the new style.

Designing the Document Actions Task Pane

You have created, tested, tweaked, and refined your schemas. Your stylesheets are elegant, sophisticated, funky, or whatever other look is suited to the task at hand. The XSL transformations take your existing ...

Get Office 2003 XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.