Text Formattingdisplaying xml code using listings package

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ptha
Posts: 5
Joined: Tue Mar 30, 2010 2:40 am

displaying xml code using listings package

Post by ptha »

I'm trying to display a wsdl file (so XML) in an appendix. I'm using the listings package with the following code:

Code: Select all

\lstset{
language=XML,
basicstyle=\footnotesize,
numberstyle=\footnotesize, 
breaklines=true
showspaces=false,         
showstringspaces=false,
showtabs=false,
frame=single,
tabsize=4,	
title=\lstname
}

\lstinputlisting{TrainingService.wsdl}
However when I look at the output it seems like whitespace is being inserted all over the place. Here's some text I've cut and pasted from the outputted pdf:

<o u t p u t>
<s o a p : b o d y us e=” l i t e r a l ”></ s o a p : b o d y>
</ o u t p u t>
</ d e f i n i t i o n s>

Is this normal, or am I doing something wrong. If I change the language option to Java, some of the white space is removed

<o u t p u t>
<soap : body us e=” l i t e r a l ”></ soap : body>
</ o u t p u t>

But it still looks a little strange.
Thanks,
Peter.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

displaying xml code using listings package

Post by localghost »

It will require a minimal example to get a clue.


Thorsten
Post Reply