Subject: sax getLineNumber under saxon From: DPawson@xxxxxxxxxxx Date: Tue, 26 Oct 1999 08:09:53 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Bean Scripting Framework available , Sanjiva Weerawarana | Thread | RE: sax getLineNumber under saxon, Kay Michael |
RE: OT: XML Server dream, DPawson | Date | output method: all or none. (was Re, Nikita Ogievetsky |
Month |