[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sax getLineNumber under saxon

Subject: sax getLineNumber under saxon
From: DPawson@xxxxxxxxxxx
Date: Tue, 26 Oct 1999 08:09:53 +0100
getlinenumber
I'm trying to output the line number of an 'error'
(according to schematrons definition) in the XML 
source file (with a weak comprehension of java<grin/>)

I think I'm nearly there with the following

<?xml version="1.0"?>

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  
    
    version="1.0">
  <xsl:output type ='text'/>


  <xsl:template match="/doc/section/p"> **************************
<xsl:variable name="lineno" select="sax:getLineNumber()"
  xmlns:sax="/org.xml.sax.Locator"
/> 
  <xsl:value-of select="$lineno"/>
  </xsl:template>

</xsl:stylesheet>

Saxon tells me


 Error processing source document
At xsl:variable on line 21 of file:/f:/sgml/xsl/trash.xsl: Cannot
instantiate 
object for extension function getLineNumber
Elapsed time: 1462 milliseconds


My interpretation of this is nil.
Could anyone help please.

I understand that the line number will be
'later' than the actual, but close enough (I hope).

On the wish list,
given

file root.xml

<doc>

&chap1;

</doc>

etc, I.e. documents which include others,
is Sax clever enough to tell me which file its
looking at as well?

TIA, DaveP


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.