1 /*
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Oct 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.xpath.internal;
23
40 import com.sun.org.apache.xpath.internal.objects.XObject;
41 import com.sun.org.apache.xpath.internal.objects.XString;
42 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
43 import java.lang.reflect.Method;
44 import java.util.ArrayList;
45 import java.util.HashMap;
46 import java.util.Iterator;
47 import java.util.List;
48 import java.util.Map;
49 import java.util.Stack;
50 import javax.xml.transform.ErrorListener;
51 import javax.xml.transform.SourceLocator;
52 import javax.xml.transform.URIResolver;
53 import org.xml.sax.XMLReader;
54
55 /**
56 * Default class for the runtime execution context for XPath.
57 *
58 * <p>This class extends DTMManager but does not directly implement it.</p>
59 * @xsl.usage advanced
60 */
61 public class XPathContext extends DTMManager // implements ExpressionContext
62 {
63 IntStack m_last_pushed_rtfdtm=new IntStack();
64 /**
65 * Stack of cached "reusable" DTMs for Result Tree Fragments.
66 * This is a kluge to handle the problem of starting an RTF before
67 * the old one is complete.
68 *
69 * %REVIEW% I'm using a Vector rather than Stack so we can reuse
70 * the DTMs if the problem occurs multiple times. I'm not sure that's
71 * really a net win versus discarding the DTM and starting a new one...
72 * but the retained RTF DTM will have been tail-pruned so should be small.
73 */
74 private List<DTM> m_rtfdtm_stack=null;
75 /** Index of currently active RTF DTM in m_rtfdtm_stack */
76 private int m_which_rtfdtm=-1;
77
78 /**
79 * Most recent "reusable" DTM for Global Result Tree Fragments. No stack is
|
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.xpath.internal;
22
39 import com.sun.org.apache.xpath.internal.objects.XObject;
40 import com.sun.org.apache.xpath.internal.objects.XString;
41 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
42 import java.lang.reflect.Method;
43 import java.util.ArrayList;
44 import java.util.HashMap;
45 import java.util.Iterator;
46 import java.util.List;
47 import java.util.Map;
48 import java.util.Stack;
49 import javax.xml.transform.ErrorListener;
50 import javax.xml.transform.SourceLocator;
51 import javax.xml.transform.URIResolver;
52 import org.xml.sax.XMLReader;
53
54 /**
55 * Default class for the runtime execution context for XPath.
56 *
57 * <p>This class extends DTMManager but does not directly implement it.</p>
58 * @xsl.usage advanced
59 * @LastModified: Oct 2017
60 */
61 public class XPathContext extends DTMManager // implements ExpressionContext
62 {
63 IntStack m_last_pushed_rtfdtm=new IntStack();
64 /**
65 * Stack of cached "reusable" DTMs for Result Tree Fragments.
66 * This is a kluge to handle the problem of starting an RTF before
67 * the old one is complete.
68 *
69 * %REVIEW% I'm using a Vector rather than Stack so we can reuse
70 * the DTMs if the problem occurs multiple times. I'm not sure that's
71 * really a net win versus discarding the DTM and starting a new one...
72 * but the retained RTF DTM will have been tail-pruned so should be small.
73 */
74 private List<DTM> m_rtfdtm_stack=null;
75 /** Index of currently active RTF DTM in m_rtfdtm_stack */
76 private int m_which_rtfdtm=-1;
77
78 /**
79 * Most recent "reusable" DTM for Global Result Tree Fragments. No stack is
|