|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] sax getLineNumber under saxon
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








