286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 1999-2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A/*
286N/A * $Id: DTMNodeListBase.java,v 1.2.4.1 2005/09/15 08:15:04 suresh_emailid Exp $
286N/A */
286N/Apackage com.sun.org.apache.xml.internal.dtm.ref;
286N/Aimport org.w3c.dom.Node;
286N/A
286N/A/**
286N/A * <code>DTMNodeList</code> gives us an implementation of the DOM's
286N/A * NodeList interface wrapped around a DTM Iterator. The author
286N/A * considers this something of an abominations, since NodeList was not
286N/A * intended to be a general purpose "list of nodes" API and is
286N/A * generally considered by the DOM WG to have be a mistake... but I'm
286N/A * told that some of the XPath/XSLT folks say they must have this
286N/A * solution.
286N/A *
286N/A * Please note that this is not necessarily equivlaent to a DOM
286N/A * NodeList operating over the same document. In particular:
286N/A * <ul>
286N/A *
286N/A * <li>If there are several Text nodes in logical succession (ie,
286N/A * across CDATASection and EntityReference boundaries), we will return
286N/A * only the first; the caller is responsible for stepping through
286N/A * them.
286N/A * (%REVIEW% Provide a convenience routine here to assist, pending
286N/A * proposed DOM Level 3 getAdjacentText() operation?) </li>
286N/A *
286N/A * <li>Since the whole XPath/XSLT architecture assumes that the source
286N/A * document is not altered while we're working with it, we do not
286N/A * promise to implement the DOM NodeList's "live view" response to
286N/A * document mutation. </li>
286N/A *
286N/A * </ul>
286N/A *
286N/A * <p>State: In progress!!</p>
286N/A *
286N/A */
286N/Apublic class DTMNodeListBase implements org.w3c.dom.NodeList {
286N/A public DTMNodeListBase() {
286N/A }
286N/A
286N/A //================================================================
286N/A // org.w3c.dom.NodeList API follows
286N/A
286N/A /**
286N/A * Returns the <code>index</code>th item in the collection. If
286N/A * <code>index</code> is greater than or equal to the number of nodes in
286N/A * the list, this returns <code>null</code>.
286N/A * @param index Index into the collection.
286N/A * @return The node at the <code>index</code>th position in the
286N/A * <code>NodeList</code>, or <code>null</code> if that is not a valid
286N/A * index.
286N/A */
286N/A public Node item(int index) {
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * The number of nodes in the list. The range of valid child node indices
286N/A * is 0 to <code>length-1</code> inclusive.
286N/A */
286N/A public int getLength() {
286N/A return 0;
286N/A }
286N/A}