Macro Language Reference > PIs > Text > <?tagtrace>
  
<?tagtrace>
Description
Tag tracing is a template debugging facility. When activated, it logs all the PTC ALD text tags in a document, and the streams from which they were read, in the order they were encountered during the formatting process. Tag tracing is configured via the tragtracefdpref macro or PI. See Technote 0101: Tag Tracing Debug Facility for further information about the facility.
 
Example 511. Tagtrace debug facility output
Below are the first few lines of a text stream called strm0 in a document entitled Demo File:
<pagehead>Demo File
<body>Welcome to PTC ALD. This file contains a few paragraphs
for you to experiment with and some instructions on how to
change paragraph styles.
<body> In the column that...
The tagtrace output from this file is shown below:
Stream: strm0
0: <pagehead>
Stream: pagehead
0: <?tlb=1.2*h><?th=24pt><?0,0,0,0,0,1,0,0,1.2303,0,5>
Stream: strm0
20: <body>
Stream:body
0: <?th=14pt><?tlb=1.2*h><0,1,2.5,0,2.5,1,0,0,1.2303,0,5>
162: body
Stream: body
0: <?th=14pt><?tlb=1.2*h><0,1,2.5,0,2.5,1,0,0,1.2303,0,5>
 
The tagtrace output does not contain any textual content, only the streams and tags that PTC ALD processes during formatting.
 
The output is indented according to the stream nesting.
 
The output shows the position in the stream where a tag is found.
 
Consecutive tags are placed together on the same line.
Syntax
<?tagtrace mode:o? op:L? args:b?>
mode
0
Turn tag tracing off
1
Turn tag tracing on
This parameter should not be passed if selecting !+, !s or !x as the value of op below.
op
The type of information that is to be written to the log, and the conditions under which the writing should be triggered:
+
Write the args/text that follow the + to the log IF tag tracing is active.
!+
Write the args/text that follow the + to the log whether or not tag tracing is currently active.
 
Do not pass mode parameter if selecting this option.
s
Log all non-empty format strings IF tag tracing is active.
!s
Log all non-empty format string values whether or not tag tracing is currently active.
 
Do not pass mode parameter if selecting this option.
x
Log all non-zero counter values IF tag tracing is currently active.
!x
Log all non-zero counter values whether or not tag tracing is currently active.
 
Do not pass mode parameter if selecting this option.
args
Any actual information that is to be included when writing to the log:
string
A string of text normally entered at a certain point in the formatting specifically to be written to the log
var=^var...
Variable
Additional Information
 
Tagtrace can be configured to ignore any <?tagtrace> PIs, in which case these do not have any effect.
The tagtrace log shows the order in which PTC ALD reads and formats tags: this information can be useful when debugging a template although it can present an alternative picture of the document than would be expected by looking at the document itself. For instance, if a tag results in text flowing over a page break, the tag itself may be read more than once by the formatting engine, which in turn could cause other tags to be reprocessed. This should be borne in mind when reading a tagtrace log output.
For more information,. see Technote 0101: Tag Tracing Debug Facility.
Related Links