<for-each select="$record-separators">
<variable name="position" select="position()"/>
<variable name="prev-separator" select="$record-separators[($position)-1]"/>
<variable name="fields" select="$noshebang[following-sibling::*[generate-id()=generate-id(current())] and (not($prev-separator) or preceding-sibling::*[generate-id()=generate-id($prev-separator)])]"/>
<if test="$fields">
<for-each select="$record-separators">
<variable name="position" select="position()"/>
<variable name="prev-separator" select="$record-separators[($position)-1]"/>
<variable name="fields" select="$noshebang[following-sibling::*[generate-id()=generate-id(current())] and (not($prev-separator) or preceding-sibling::*[generate-id()=generate-id($prev-separator)])]"/>
<if test="$fields">