Hi all again,

now I'm having some difficulties using saxon:line-number function with JAXP API. The stylesheet below is returning the following error in function saxon:line-number. Anyone has any ideas of what is happening?

EXCEPTION:

Error on line 15
  Cannot find a matching 0-argument function named {http://icl.com/saxon}line-number()
  in built-in template rule
  at xsl:apply-templates (#11)
     processing /ncl/head[1]/regionBase[1]/region[1]
  in built-in template rule
  in built-in template rule
Caused by: net.sf.saxon.trans.XPathException: Cannot find a matching 0-argument function named {http://icl.com/saxon}line-number()
    at net.sf.saxon.expr.ErrorExpression.evaluateItem(ErrorExpression.java:58)
    at net.sf.saxon.expr.ErrorExpression.iterate(ErrorExpression.java:71)
    at net.sf.saxon.expr.Atomizer.iterate(Atomizer.java:180)
    at net.sf.saxon.expr.FirstItemExpression.evaluateItem(FirstItemExpression.java:96)
    at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:316)
    at net.sf.saxon.instruct.SimpleNodeConstructor.expandChildren(SimpleNodeConstructor.java:254)
    at net.sf.saxon.instruct.SimpleNodeConstructor.processLeavingTail(SimpleNodeConstructor.java:193)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:619)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
    at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:619)
    at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:229)
    at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:346)
    at net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:377)
    at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:334)
    at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
    at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:170)
    at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)
    at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:229)
    at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:346)
    at net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:377)
    at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:334)
    at net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:377)
    at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:334)
    at net.sf.saxon.Controller.transformDocument(Controller.java:1851)
    at net.sf.saxon.Controller.transform(Controller.java:1702)
    at br.pucrio.inf.serg.nclinspector.rulesengine.core.xslt.XSLTInspector.visit(XSLTInspector.java:70)
    ... 5 more

STYLESHEET:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform
    xmlns:saxon="http://icl.com/saxon"
      extension-element-prefixes="saxon"
      xpath-default-namespace="http://www.ncl.org.br/NCL3.0/EDTVProfile">
     
    <xsl:template match="/ncl/head/regionBase">
        <result>
            <xsl:apply-templates />
        </result>
    </xsl:template>
    <xsl:template match="region[@top][@bottom][@height]">
        <violation line="{saxon:line-number()}" column="{saxon:column-number()}" msgKey="topBottomHeight" severity="warning">
            <arg><xsl:value-of select="./@id"/></arg>
        </violation>
        <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="region[@left][@right][@width]">
        <violation line="1" column="1" msgKey="leftRightWidth" severity="warning">
            <arg><xsl:value-of select="./@id"/></arg>
        </violation>
        <xsl:apply-templates />
    </xsl:template>
</xsl:stylesheet>

Thanks in advance,
Gustavo Honorato