Macro Language Reference > PIs > Text > <?smapret>
  
<?smapret>
Description
Specifies that a given text stream should map all hard return characters in the stream to a space. Used in conjunction with the <?smaprety> command, which maps the spaces.
Syntax
<?smapret on_off:n? level:n?>
on_off
0
Off
1
On
2
Use default setting for the stream
level
Level to which the mapping of characters/spaces should apply.
0
Root level - text stream
1
Current level
2
Sub level
See the example below for an explanation of levels mentioned here.
Additional Information
As an example, the document to be formatted contains a text stream called strm0 as the stream being formatted. This stream calls the tag body which in turn calls textstyle. This gives the following hierarchy:
textstyle (level 2)
body (level 1)
strm0 (root - level 0)
If the PI <?smapret 1,1> is placed in strm0, so there is no level 1 tag, then it will apply to the current tag, i.e. strm0. This means that setting a level to a high number (e.g. 99) will ensure that the PI will always apply to the current tag regardless of its position in the hierarchy.
If level is set greater than 0, then the space flag will apply to that level, i.e. if textstyle contains <?smapret 1,1> then only hard returns inside body will be mapped. Returns inside strm0 and textstyle will still be processed as normal. In other words, the tag to apply the PI to is counted upwards from the main root tag.
If level is less than 0, then the space flag will apply to the tag at the level counting downwards from the current tag, so if you put <?smapret 1,-1> in textstyle then the PI will act on its parent (body), <?smapret 1,-2> will act on its grandparent (strm0), etc.
Related Links