I think it would be nicer if RXML backtrace shows extra information like below:
RXML run error: No such variable (full).
| libfile,line 27: <insert variable="full">
| libfile,line 25: <emit host="ng_db" query="SELECT NOW()" source="sql">
| test.html,line 102: <testtag2>
I believe it will help filename is printed. With line number, definitly it helps a lot!.
Is it difficult to implement?
You're absolutely right. Unfortunately it is not so easy, and it would add some overhead in all rxml execution.
A complicating factor is that the rxml often is the result of an xsl transformation, and then one would want the files and lines from the xsl source files rather than from the xml result which the rxml hacker almost never sees. That means the xslt engine has to add some sort of magic attributes with file/line info on every tag. Of course doing that would incur a quite significant overhead, not least because the output xml is cached and all those extra attributes could easily make it twice as large or more.
But here's a tip that may help a little: It's often possible to add a phony extra attribute which you can the look for in the backtrace. So if you suspect a tag you could do something like:
<insert variable="full" scoobydoo="&page.path;"/>
and then see if you get "scoobydoo" in the backtrace.
The <debug> tag can also be useful to add some trace calls.