jaxp/src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java
author duke
Wed, 05 Jul 2017 19:04:46 +0200
changeset 18896 98b0babd0565
parent 12457 c348e06f0e82
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 1999-2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * $Id: NodeInfo.java,v 1.2.4.1 2005/09/10 18:54:37 jeffsuttor Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
package com.sun.org.apache.xalan.internal.lib;
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
import javax.xml.transform.SourceLocator;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import org.w3c.dom.Node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import org.w3c.dom.NodeList;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * <code>NodeInfo</code> defines a set of XSLT extension functions to be
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * used from stylesheets.
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * @since May 24, 2001
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
public class NodeInfo
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
   * <code>systemId</code> returns the system id of the current
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
   * context node.
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
   * @param context an <code>ExpressionContext</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
   * @return a <code>String</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
  public static String systemId(ExpressionContext context)
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
    Node contextNode = context.getContextNode();
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
      return locator.getSystemId();
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
   * <code>systemId</code> returns the system id of the node passed as
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
   * argument. If a node set is passed as argument, the system id of
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
   * the first node in the set is returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
   * @param nodeList a <code>NodeList</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
   * @return a <code>String</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
  public static String systemId(NodeList nodeList)
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
    if (nodeList == null || nodeList.getLength() == 0)
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
    Node node = nodeList.item(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
      return locator.getSystemId();
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
   * <code>publicId</code> returns the public identifier of the current
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
   * context node.
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
   * Xalan does not currently record this value, and will return null.
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
   * @param context an <code>ExpressionContext</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
   * @return a <code>String</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
  public static String publicId(ExpressionContext context)
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    Node contextNode = context.getContextNode();
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
      return locator.getPublicId();
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
   * <code>publicId</code> returns the public identifier of the node passed as
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
   * argument. If a node set is passed as argument, the public identifier of
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
   * the first node in the set is returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
   * Xalan does not currently record this value, and will return null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
   * @param nodeList a <code>NodeList</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
   * @return a <code>String</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
  public static String publicId(NodeList nodeList)
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
    if (nodeList == null || nodeList.getLength() == 0)
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
    Node node = nodeList.item(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
      return locator.getPublicId();
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
      return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
   * <code>lineNumber</code> returns the line number of the current
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
   * context node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
   * NOTE: Xalan does not normally record location information for each node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
   * To obtain it, you must set the custom TrAX attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
   * "http://xml.apache.org/xalan/features/source_location"
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
   * true in the TransformerFactory before generating the Transformer and executing
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
   * the stylesheet. Storage cost per node will be noticably increased in this mode.
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
   * @param context an <code>ExpressionContext</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
   * @return an <code>int</code> value. This may be -1 to indicate that the
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
   * line number is not known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
  public static int lineNumber(ExpressionContext context)
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
    Node contextNode = context.getContextNode();
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
      return locator.getLineNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
      return -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
   * <code>lineNumber</code> returns the line number of the node
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
   * passed as argument. If a node set is passed as argument, the line
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
   * number of the first node in the set is returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
   * NOTE: Xalan does not normally record location information for each node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
   * To obtain it, you must set the custom TrAX attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
   * "http://xml.apache.org/xalan/features/source_location"
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
   * true in the TransformerFactory before generating the Transformer and executing
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
   * the stylesheet. Storage cost per node will be noticably increased in this mode.
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
   * @param nodeList a <code>NodeList</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
   * @return an <code>int</code> value. This may be -1 to indicate that the
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
   * line number is not known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
  public static int lineNumber(NodeList nodeList)
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
    if (nodeList == null || nodeList.getLength() == 0)
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
      return -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
    Node node = nodeList.item(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
      return locator.getLineNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
      return -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
   * <code>columnNumber</code> returns the column number of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
   * current context node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
   * NOTE: Xalan does not normally record location information for each node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
   * To obtain it, you must set the custom TrAX attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
   * "http://xml.apache.org/xalan/features/source_location"
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
   * true in the TransformerFactory before generating the Transformer and executing
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
   * the stylesheet. Storage cost per node will be noticably increased in this mode.
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
   * @param context an <code>ExpressionContext</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
   * @return an <code>int</code> value. This may be -1 to indicate that the
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
   * column number is not known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
  public static int columnNumber(ExpressionContext context)
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
    Node contextNode = context.getContextNode();
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
      return locator.getColumnNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
      return -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
   * <code>columnNumber</code> returns the column number of the node
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
   * passed as argument. If a node set is passed as argument, the line
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
   * number of the first node in the set is returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
   * NOTE: Xalan does not normally record location information for each node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
   * To obtain it, you must set the custom TrAX attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
   * "http://xml.apache.org/xalan/features/source_location"
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
   * true in the TransformerFactory before generating the Transformer and executing
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
   * the stylesheet. Storage cost per node will be noticably increased in this mode.
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
   * @param nodeList a <code>NodeList</code> value
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
   * @return an <code>int</code> value. This may be -1 to indicate that the
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
   * column number is not known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
  public static int columnNumber(NodeList nodeList)
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
    if (nodeList == null || nodeList.getLength() == 0)
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
      return -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
    Node node = nodeList.item(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
      .getSourceLocatorFor(nodeHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
    if (locator != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
      return locator.getColumnNumber();
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
      return -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
}