How to Use the <, >, &, ", ' Symbols in BTXML
Question
How do I use the <, >, &, ", and ' symbols in BTXML without it being picked up as XML code?
Answer
This applies to XML code outside of BarTender as well, but to include these characters inside your BTXML script you must use the corresponding escape form to prevent them from being read as part of the XML code:
< → <
> → >
& → & " → "
' → '
For example, the following BTXML produces a label with < Sample Text > on the object: