I know I can include a portion of a code file like so:
\lstinputlisting[language=XML, firstline=37, lastline=45]{source_filename.xml}
But the line numbers will change if I modify the code file. Is it possible to use references to specify the first and last lines? Basically I'm envisioning something like this:
\lstinputlisting[language=XML, firstline=\ref{tag-start}, lastline=\ref{tag-end}, escapeinside={@}{@}]{source_filename.xml}
With the portion of interest in the source_filename.xml file looking something like this:
<MyTag><!-- @\label{tag-start}@ -->
...
</MyTag><!-- @\label{tag-end}@ -->
listingsdocumentation. – jub0bs Jan 23 '15 at 00:51