Macro Language Reference > Macros > Application > pi
  
pi
Description
Inserts a PI into a target stream, with specific focus on maintaining XML compliance rather than that of standard PI syntax.
Syntax
pi name_value:L
name_value
The name and value of the PI
Additional Information
pi acts in a similar way to the insert macro, but with more intelligence about its target stream.
PTC ALD uses PIs from many PI specific menus in many situations, historically in the form <?name=value>. Ordinarily, when dealing with XML in PTC ALD , inserting this form of PI into your XML stream would make the XML invalid. This macro will detect the stream type into which you are inserting a PI and modifies the insertion appropriately. For example, the code phrase pi tic=red would insert the specified PI as follows, depending on the target stream:
<?tic=red>
Non-xml (.xm) stream.
<?tic=red?>
Non-xml (.xm) stream where the document preference option XML format - PI's close with ? is set to always.
<?A3B2 tic=red?>
XML (.xm or .xs) stream.
PTC ALD will not let you insert the wrong type of PI. You can call the same PI in any of the following ways and an appropriately wrapped PI will always be inserted:
pi tic=red
pi <?tic=red>
pi <?tic=red?>
<?A3B2 tic=red?>