1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the  "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *     http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18/*
19 * $Id: DTMNodeListBase.java 468653 2006-10-28 07:07:05Z minchau $
20 */
21package org.apache.xml.dtm.ref;
22import org.w3c.dom.Node;
23
24/**
25 * <code>DTMNodeList</code> gives us an implementation of the DOM's
26 * NodeList interface wrapped around a DTM Iterator. The author
27 * considers this something of an abominations, since NodeList was not
28 * intended to be a general purpose "list of nodes" API and is
29 * generally considered by the DOM WG to have be a mistake... but I'm
30 * told that some of the XPath/XSLT folks say they must have this
31 * solution.
32 *
33 * Please note that this is not necessarily equivlaent to a DOM
34 * NodeList operating over the same document. In particular:
35 * <ul>
36 *
37 * <li>If there are several Text nodes in logical succession (ie,
38 * across CDATASection and EntityReference boundaries), we will return
39 * only the first; the caller is responsible for stepping through
40 * them.
41 * (%REVIEW% Provide a convenience routine here to assist, pending
42 * proposed DOM Level 3 getAdjacentText() operation?) </li>
43 *
44 * <li>Since the whole XPath/XSLT architecture assumes that the source
45 * document is not altered while we're working with it, we do not
46 * promise to implement the DOM NodeList's "live view" response to
47 * document mutation. </li>
48 *
49 * </ul>
50 *
51 * <p>State: In progress!!</p>
52 *
53 */
54public class DTMNodeListBase implements org.w3c.dom.NodeList {
55    public DTMNodeListBase() {
56    }
57
58    //================================================================
59    // org.w3c.dom.NodeList API follows
60
61    /**
62     * Returns the <code>index</code>th item in the collection. If
63     * <code>index</code> is greater than or equal to the number of nodes in
64     * the list, this returns <code>null</code>.
65     * @param index Index into the collection.
66     * @return The node at the <code>index</code>th position in the
67     *   <code>NodeList</code>, or <code>null</code> if that is not a valid
68     *   index.
69     */
70    public Node item(int index) {
71        return null;
72    }
73
74    /**
75     * The number of nodes in the list. The range of valid child node indices
76     * is 0 to <code>length-1</code> inclusive.
77     */
78    public int getLength() {
79        return 0;
80    }
81}
82