Trying to pretty-print XML within pango markup language
- From: Dave Malcolm <david davemalcolm demon co uk>
- To: gtk-list gnome org
- Subject: Trying to pretty-print XML within pango markup language
- Date: 26 May 2003 01:47:38 +0000
I want to use the Pango markup language to display syntax-highlighted
XML in a GtkTreeView. Unfortunately, XML looks a lot like the Pango
markup language. Is there a way of "escaping" my "<" and ">" symbols,
perhaps using "<"; and ">"?
As a nasty example, consider the case where you want to display the text
"<span>", showing the enclosing symbols in a different colour to the
word "span". A naive approach suggests something like:
"<span foreground="red"><</span>span<span foreground="red">></span>"
In case it "just worked", I tried this, but I get errors like
(conge:31728): Gtk-WARNING **: Failed to set cell text from markup due
to error parsing markup: Error on line 1 char 33: '<' is not a valid
character following a '<' character; it may not begin an element name
Any ideas? Can this be fixed without potentially breaking existing
apps. Possibly by adding an attribute to the root "markup" tag?
Or am I missing something obvious?
] [Thread Prev