This topic explains when the syntax tree is created and how to access it.
Ignored Content
Overview
Even though the syntax analyzer ignores insignificant tokens and skips unexpected tokens, they are still stored in the syntax tree because the syntax tree must represent the full content of the document. When the syntax analyzer comes across content which it can ignore, it gathers it up and stores it as “ignored content” on the next token node which is not ignored. This content is then accessible with the GetLeadingIgnoredContent method on the token node and all its ancestor nodes for which it is the first token node. This method returns an IgnoredContentList class, which is a collection with the following key members: