Project

Profile

Help

Try to get line number

Added by GANESH ILANGOVAN over 9 years ago

Hi,

I am using a big schematron file for validation. I would like to know if i can get line number of the error message, so that our users can able to narrow down to the issue easily.

when i googled i came to know that we can use the saxon:line–number() extension to report line numbers. But i can't find more info. on how to implement it in .net. Can any of you help me?

i am using 9.5.1.5 version.

Thanks, Ganesh


Replies (1)

RE: Try to get line number - Added by Michael Kay over 9 years ago

To call saxon:line-number() you need to:

(1) install Saxon-PE or Saxon-EE with a valid license

(2) declare the "saxon" namespace prefix (xmlns:saxon="http://saxon.sf.net/")

(3) ensure that the document containing the context node was built with line numbering enabled.

To build a document with line numbering enabled you can do any of the following:

(1) Use the -l (letter ell) option on the command line

(2) Set the configuration property "http://saxon.sf.net/feature/linenumbering" to true. On .NET, use Processor.SetProperty("http://saxon.sf.net/feature/linenumbering", "true")

(3) Set line numbering when building the individual document: on .NET, use DocumentBuilder.Build having set the IsLineNumbering property on the builder.

If you are still having difficulty, please explain what you are doing and how it fails.

    (1-1/1)

    Please register to reply