PTC ALD in Arbortext Styler > Components of Documents and Templates > Conditional Text Formatting > Conditional Formatting
Conditional Formatting
Basic Principles
Many XML formatting engines allow you to test the hierarchy of content and associate formatting properties based on the result of those tests. PTC Arbortext Layout Developer provides this functionality, using XPath and counters, and has other information available to provide additional flexibility.
PTC Arbortext Layout Developer provides these tools to template developers for conditional formatting:
Attribute testing — classed as separate from XPath with the way PTC Arbortext Layout Developer passes attributes to the tags selected during text formatting
Refer to Attribute Handling for information.
Formatting results — a powerful tool to use to specify formatting based on information PTC Arbortext Layout Developer generates while it is formatting
Formatting results are obtained from PTC Arbortext Layout Developer’s getvar variables.
Refer to Format Result Testing for information.
XPath — a standard language to test XML content hierarchy and long-range content structures
Refer to Content and Context Tests with XPath for information.
Refer to XPath in PTC Arbortext Layout Developer for a general description of XPath support.
Global variables — can be passed between documents and are always available from any content stream, tag, or script
Refer to System Information with Global Variables for information.
Counters — a format-safe way to store information that can be tested later
Refer to Tracking Formatting with Counters
Tag information — graphic and text information can be used to further drive conditional formatting
Environment information — information such as date and time, user name, operating system, and PTC Arbortext Layout Developer deployment accessed from PTC Arbortext Layout Developer
The majority of this information is available through JavaScript. It may be necessary use other methods to access some of the information, for example using showstrings or Perl.