Wed Apr 13 05:13:46 2011, original submission:
Franco Alberto Cardillo wrote, on Fri, 05 Mar 2010 13:29:36 +0100:
Hello Sir,
I need to put beautifully formatted XML source code in a latex document. I chose to use the Listings package and read the documentation. However, I am not able to modify how the XML code is printed.
I want to insert the following XML code:
<?xml version='1.0' encoding='UTF-8'?>
<BASE>
<NAME>myName</NAME>
<DOMAIN>domain</DOMAIN>
<NOTICES>
<NOTICE ID="ID">
...
</NOTICE>
</NOTICES>
</BASE>
I am able to have BASE, DOMAINE, etc in green color, however I am not able to have <, >, <?, etc in that color or another one at the same time.
The latex source code follows (the commented lines are previous attempts).
stset{
language=XML,
basicstyle=\ttfamily\footnotesize,
frame=leftline,
backgroundcolor=\color{bggray},
stringstyle=\color{blue},
%emph={[1]<,>}, emphstyle={[1]\color{red}},
%emph={[1]NOTICE,NOTICES,NAME,BASE,DOMAINE}, emphstyle={[1]\color{red}},
%emph={[2]<?,?>}, emphstyle={[2]\color{green}},
morekeywords={[1]NOTICE,NOTICES,NAME,BASE,DOMAINE},keywordstyle={[1]\color{red}},
%otherkeywords={<NOTICE>,</NOTICE>},keywordstyle=\color{red}
}}{}
I hope you will find some minutes to help me.
Thanks anyway!
Regards,
FA Cardillo
|