Eugene Toporov wrote:
Thanks a lot, Taco!

I knew there should be a good way!
Maybe it would be useful to add it to http://contextgarden.net/Verbatim_text ?

Be my guest ;-)

I also noticed that XML verbatim does not correctly handle tags with namespace. In the xml like <ns:tag attribute="somevalue"> the "ns" gets colored with tag-color, the "tag" with attr-color. I think the whole "ns:tag" should be of tag-color.

How about this?

  %% allows XML tag names to continue after colons (namespaces)
  \input verb-xml % TRICK
  \appended\gdef\XMLsetspecials{\setpretty`\:=10 }

  \starttext
  \startXML
    <ns:tag attribute="somevalue" />
  \stopXML
  \stoptext
  %%

You can use  \setpretty`\:=17 instead, if you want the colon to be
indistinguisable from the rest of the tag.

The line I've marked 'TRICK' is needed to make sure that the original
definition of \XMLsetspecials is loaded before the new addition takes
place (verbatim definitions are loaded runtime).

Cheers, Taco
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to