There are many useful FrameMaker plugins out there, but one of my favorites is FrameSLT by West Street Consulting, operated by Russ Ward. I was reminded of how powerful it is when I recently helped a client add structure to a large number of unstructured documents. One issue was a very specific sequence of elements where text nodes needed to be wrapped in <cmdname> elements. In the screenshot below, I have the text nodes indicated by red rectangles. The yellow highlighting indicates the specific context where the text nodes needed to be located.
Doing it by hand would entail searching for <codeph> elements and then visually checking their parent elements to see if the text nodes should be wrapped. This would not be a reasonable approach for hundreds of documents to process. Enter FrameSLT, which allows you to use XPath expressions to search for element/attribute combinations in structured FrameMaker documents. Here is a screenshot of FrameSLT’s “Node Wizard” with the XPath statement in place.
Here is the breakdown of the XPath statement:
Start at the top of the structure and find unwrapped text nodes.
Make sure the text node is a child of a <codeph> element.
Make sure the <codeph> element is a child of a <codeblock> element.
Make sure the <codeblock> element is a child of a <section> element, whose outputclass attribute value is “cli-syntax”.
As you can see, XPath lets you be very specific with the elements and attributes that you are trying to locate.
If you look at the lower highlighting on the Node Wizard screenshot above, you can see that FrameSLT lets you perform actions on the elements that it finds. In this case, we want to wrap the text nodes in <cmdname> elements. FrameSLT can perform this operation on hundreds of text nodes in seconds; the results are shown in yellow below.
FrameSLT has a bunch of other useful features that we won’t go into here. Try out the demo version and you will discover more powerful tools for working with structured FrameMaker documents.
One more thing to mention for FrameScript users: FrameSLT can be controlled by FrameScript scripts and FDK clients. This gives you the capability to use XPath in your scripts (and plugins), which greatly simplifies the code required for locating elements and attributes. For more information, visit West Street Consulting.