[Templates] Line number in Template

Franz Martin martin.franz@mm-karton.com
Fri, 29 Sep 2006 15:35:59 +0200


This is a multi-part message in MIME format.

------_=_NextPart_001_01C6E3CC.331386E7
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Hi !
I'm generating XML files with TT2. The resulting XML files are then
postprocessed with XML::Parser.

My problem is, tracing errors in the resulting XML back to the template
(where the illegal XML is generated) is quite hard.=20

My current idea (maybe you know something better) is, to set some "mark"
in the XML file, which gives a reference to the Template File. Example:

<mark ttfile=3D"[% component.name %]"/>

What would help even more, is the line number inside the template.
Unfortunatly, I don't know, how to get that.

Does anybody know, how the get the actual line number in the template ?

best regards, Martin

------_=_NextPart_001_01C6E3CC.331386E7
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7650.5">
<TITLE>Line number in Template</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi !</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">I'm generating XML files with TT2. The =
resulting XML files are then postprocessed with XML::Parser.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">My problem is, tracing errors in the =
resulting XML back to the template (where the illegal XML is generated) =
is quite hard. </FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">My current idea (maybe you know =
something better) is, to set some &quot;mark&quot; in the XML file, =
which gives a reference to the Template File. Example:</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&lt;mark ttfile=3D&quot;[% =
component.name %]&quot;/&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">What would help even more, is the line =
number inside the template. Unfortunatly, I don't know, how to get =
that.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Does anybody know, how the get the =
actual line number in the template ?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">best regards, Martin</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C6E3CC.331386E7--