xsl-list
[Top] [All Lists]

Re: [xsl] __LINE__ equivalent in XSTL

2011-12-02 06:51:10
As Ken said the XSLT processor can have line number information.


An XPath expression for a given stylesheet's nodes can be considered
as an equivalent of "line number".

Please see Oliver Becker's solution on getting trace output for XSLT:
http://www2.informatik.hu-berlin.de/~obecker/XSLT/#trace


Saxon extension "saxon:path" might be useful.

Or, if you do not use saxon, this posting of Dimitre on Dave's XSL FAQ:
http://www.dpawson.co.uk/xsl/sect2/N6077.html#d8281e21



Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Level 3 support for XML Compiler team, Fixpack team lead
WebSphere DataPower SOA Appliances
https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


                                                                                
                                                        
  From:       "G. Ken Holman" <gkholman(_at_)CraneSoftwrights(_dot_)com>        
                                                                   
                                                                                
                                                        
  To:         xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com, 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com,                               
                          
                                                                                
                                                        
  Date:       12/02/2011 01:28 PM                                               
                                                        
                                                                                
                                                        
  Subject:    Re: [xsl] __LINE__ equivalent in XSTL                             
                                                        
                                                                                
                                                        





At 2011-12-02 13:14 +0100, Bartolomeo Nicolotti wrote:
in C there's a pre-processor directive

__LINE__

that gives you the line of source where the directive is.

Is there an equivalent in XSLT?

No ... how were you planning to exploit this information in your
transformation?  Perhaps there is something else to help you.

Remember that the input lines of all documents fed into the XSLT
processor are not accessible to an XSLT transformation because the
transformation works on XPath node trees interpreted from those sources.

The XSLT processor, itself, may keep track of input source lines, but
this is an aspect of the processor and not of the W3C specification.

I hope this helps.

. . . . . . . . . Ken


--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 & 2.0 http://ude.my/t37DVX
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--