Description
There are some Trace statements in the source code that are used when errors occur during parsing or processing. It would be helpful if the errors/warnings are accessible as part of the document element, this can be useful for debugging or for providing feedback on processed elements.
One of the examples this could be useful is when the hex color is invalid, this currently crashes the lexer (which should not happen). I did some changes to throw an exception in that case, but as stated by @mrbean-bremen we would like to simulate browser behaviour, so crashing is not the way to go. However, logging this in a data structure accessible by the consuming code can be very helpful. The message system can be something as simple as a list of objects with a severity (warning/error and the message).