About Arbortext Styler > Document Preview and Publishing > Print Features Available with PTC Arbortext Layout Developer > Testing
Testing is one of PTC Arbortext Layout Developer's strongest features. It provides access to content hierarchy testing though XPath. It also supplies a number of other tools that allow you to associate formatting properties and behavior, and output, with the results of the tests.
Format result testing
While PTC Arbortext Layout Developer is formatting a document, it allows access to some information. This information can then be tested and used to drive output. Useful format results to test include (but are not limited to):
Paragraph and text properties
Current text height
Current font
Current text baseline position from top of page
Line number on page/paragraph/column
Current column width
Number of column where paragraph started
Document and page properties
Number of current, first, or last page
Number of pages
Page sequence used to generate current page
Name of main layer on current page
Table properties
Number of current row
Number of current cell in row
Column width
Content properties
Size of text content stream (number of characters)
The depth a content stream would format to, when it is of a certain width
Current position in text stream
Dimensions of a graphic
Graphic resolution
File type
Location of source file
Color type of graphic
System and interface information
Current date and time
Mouse position
These values are mostly available through PTC Arbortext Layout Developer getvars, which are exposed as global variables. Others are available through certain functions. Any of these values can be accessed through PTC ALD source code edits to the .style stylesheet.
Refer to Stylesheet Developer’s Guide to APP Code for some examples of how to test and use formatting information.
Using content as trigger for style changes
It is sometimes necessary to change formatting properties or insert an item when a particular character or pattern is matched, without markup being present to do this. For example, a price field in a table may be given as $123.45, but the output requirements state that the $ symbol should be separated from the price, which is aligned on the decimal point. As another example, the first two or three words of the first paragraph can be output in small capitals, then the paragraph reverts to normal case.
Effects of this type are possible in PTC Arbortext Layout Developer using either a hash callout or a yank function. Hash callouts are a means of using a character as a trigger to execute some additional PTC Arbortext Layout Developer code. Yanks allow the extraction of content from the main content stream, following a matched pattern. That content can be passed to a variable, a string counter, or another content stream, then output as required.
This type of customization can be achieved using source code edits, but will probably require additional support from GSO to implement.