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
• 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.
• XPath — a standard language to test XML content hierarchy and long-range content structures
• Global variables — can be passed between documents and are always available from any content stream, tag, or script
• Counters — a format-safe way to store information that can be tested later
• 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.