source: CMDIValidator/trunk/cmdi-validator-core/src/main/java/eu/clarin/cmdi/validator/utils/SaxonLocationUtils.java @ 5396

Last change on this file since 5396 was 5396, checked in by Oliver Schonefeld, 10 years ago
  • add license
  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1/**
2 * This software is copyright (c) 2014 by
3 *  - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de)
4 * This is free software. You can redistribute it
5 * and/or modify it under the terms described in
6 * the GNU General Public License v3 of which you
7 * should have received a copy. Otherwise you can download
8 * it from
9 *
10 *   http://www.gnu.org/licenses/gpl-3.0.txt
11 *
12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de)
13 *
14 * @license http://www.gnu.org/licenses/gpl-3.0.txt
15 *  GNU General Public License v3
16 */
17package eu.clarin.cmdi.validator.utils;
18
19import net.sf.saxon.s9api.XdmItem;
20import net.sf.saxon.s9api.XdmNode;
21
22public final class SaxonLocationUtils {
23   
24    private SaxonLocationUtils() {
25    }
26
27
28    public static int getLineNumber(final XdmItem item) {
29        if ((item != null) && (item instanceof XdmNode)) {
30            return ((XdmNode) item).getLineNumber();
31        }
32        return -1;
33    }
34
35
36    public static int getColumnNumber(final XdmItem item) {
37        if ((item != null) && (item instanceof XdmNode)) {
38            return ((XdmNode) item).getColumnNumber();
39        }
40        return -1;
41    }
42
43} // class SaxonLocationUtils
Note: See TracBrowser for help on using the repository browser.