1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Nov 2017
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 package com.sun.org.apache.xml.internal.dtm.ref;
23
36 *
37 * Please note that this is not necessarily equivlaent to a DOM
38 * NodeList operating over the same document. In particular:
39 * <ul>
40 *
41 * <li>If there are several Text nodes in logical succession (ie,
42 * across CDATASection and EntityReference boundaries), we will return
43 * only the first; the caller is responsible for stepping through
44 * them.
45 * (%REVIEW% Provide a convenience routine here to assist, pending
46 * proposed DOM Level 3 getAdjacentText() operation?) </li>
47 *
48 * <li>Since the whole XPath/XSLT architecture assumes that the source
49 * document is not altered while we're working with it, we do not
50 * promise to implement the DOM NodeList's "live view" response to
51 * document mutation. </li>
52 *
53 * </ul>
54 *
55 * <p>State: In progress!!</p>
56 * */
57 public class DTMNodeList extends DTMNodeListBase {
58 private DTMIterator m_iter;
59
60 //================================================================
61 // Methods unique to this class
62 private DTMNodeList() {
63 }
64
65 /**
66 * Public constructor: Wrap a DTMNodeList around an existing
67 * and preconfigured DTMIterator
68 *
69 * WARNING: THIS HAS THE SIDE EFFECT OF ISSUING setShouldCacheNodes(true)
70 * AGAINST THE DTMIterator.
71 *
72 */
73 public DTMNodeList(DTMIterator dtmIterator) {
74 if (dtmIterator != null) {
75 int pos = dtmIterator.getCurrentPos();
76 try {
|
1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 */
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements. See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package com.sun.org.apache.xml.internal.dtm.ref;
22
35 *
36 * Please note that this is not necessarily equivlaent to a DOM
37 * NodeList operating over the same document. In particular:
38 * <ul>
39 *
40 * <li>If there are several Text nodes in logical succession (ie,
41 * across CDATASection and EntityReference boundaries), we will return
42 * only the first; the caller is responsible for stepping through
43 * them.
44 * (%REVIEW% Provide a convenience routine here to assist, pending
45 * proposed DOM Level 3 getAdjacentText() operation?) </li>
46 *
47 * <li>Since the whole XPath/XSLT architecture assumes that the source
48 * document is not altered while we're working with it, we do not
49 * promise to implement the DOM NodeList's "live view" response to
50 * document mutation. </li>
51 *
52 * </ul>
53 *
54 * <p>State: In progress!!</p>
55 *
56 * @LastModified: Nov 2017
57 */
58 public class DTMNodeList extends DTMNodeListBase {
59 private DTMIterator m_iter;
60
61 //================================================================
62 // Methods unique to this class
63 private DTMNodeList() {
64 }
65
66 /**
67 * Public constructor: Wrap a DTMNodeList around an existing
68 * and preconfigured DTMIterator
69 *
70 * WARNING: THIS HAS THE SIDE EFFECT OF ISSUING setShouldCacheNodes(true)
71 * AGAINST THE DTMIterator.
72 *
73 */
74 public DTMNodeList(DTMIterator dtmIterator) {
75 if (dtmIterator != null) {
76 int pos = dtmIterator.getCurrentPos();
77 try {
|