Saxon will only include line numbers in a constructed tree if you set the appropriate options. It depends a bit how you are building the tree. On the TransformerFactory you can do
 
setAttribute(FeatureKeys.LINE_NUMBERING, Boolean.TRUE)
 
or there are methods to set line numbering on the Configuration and Builder classes.
 
Once the tree has been built to include line numbers, you can access the line number using the getLineNumber() method on NodeInfo.
 
P.S. Upper case and lower case are significant in Java names, and greatly help readability in English too.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of RamKumarDinesh Thillai
Sent: 04 October 2005 04:18
To: saxon-help@lists.sourceforge.net
Subject: [saxon] help in getting line number..


hi guru,
      i am using saxon for reading a node in java.when i parse a node or node list i need to get the lin number of that particular node..
how do i get i have seen te class nodeinfo has getlinenumber() option but still it is not working out could u help me out in getting the line number of a node i am reading if there is a sample code it will be more useful

regards,
ram.t