I want to use ${} in an lstlisting with xml-like code, but compiling gives "! Missing $ inserted." How I can I solve this ? I tried \${}, which clears the error on that place, but gives the error at \end{lstlisting}.
Ok, that apparently works. I checked the package that I use for the 4 listings I have so far, which is listings, not lstlistings. I checked http://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings which basically does the same as I do. And I can't find the lstlistings package. So can you tell me where I may go wrong, apart from using another package ?
The package I am using is listings. And I already told you what to do to find the error: Prepare a minimal working example! The error you are describing does not come from the dollar sign. It is impossible for me or anybody else to tell what might be wrong without any code.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.