001: /*
002: * Copyright 2001-2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: /*
017: * $Id: DOM.java,v 1.17 2004/02/16 20:54:58 minchau Exp $
018: */
019:
020: package org.apache.xalan.xsltc;
021:
022: import org.apache.xalan.xsltc.runtime.Hashtable;
023: import org.apache.xml.dtm.DTMAxisIterator;
024:
025: import org.w3c.dom.Node;
026: import org.w3c.dom.NodeList;
027:
028: import org.apache.xml.serializer.SerializationHandler;
029:
030: /**
031: * @author Jacek Ambroziak
032: * @author Santiago Pericas-Geertsen
033: */
034: public interface DOM {
035: public final static int FIRST_TYPE = 0;
036:
037: public final static int NO_TYPE = -1;
038:
039: // 0 is reserved for NodeIterator.END
040: public final static int NULL = 0;
041:
042: // used by some node iterators to know which node to return
043: public final static int RETURN_CURRENT = 0;
044: public final static int RETURN_PARENT = 1;
045:
046: // Constants used by getResultTreeFrag to indicate the types of the RTFs.
047: public final static int SIMPLE_RTF = 0;
048: public final static int ADAPTIVE_RTF = 1;
049: public final static int TREE_RTF = 2;
050:
051: /** returns singleton iterator containg the document root */
052: public DTMAxisIterator getIterator();
053:
054: public String getStringValue();
055:
056: public DTMAxisIterator getChildren(final int node);
057:
058: public DTMAxisIterator getTypedChildren(final int type);
059:
060: public DTMAxisIterator getAxisIterator(final int axis);
061:
062: public DTMAxisIterator getTypedAxisIterator(final int axis,
063: final int type);
064:
065: public DTMAxisIterator getNthDescendant(int node, int n,
066: boolean includeself);
067:
068: public DTMAxisIterator getNamespaceAxisIterator(final int axis,
069: final int ns);
070:
071: public DTMAxisIterator getNodeValueIterator(DTMAxisIterator iter,
072: int returnType, String value, boolean op);
073:
074: public DTMAxisIterator orderNodes(DTMAxisIterator source, int node);
075:
076: public String getNodeName(final int node);
077:
078: public String getNodeNameX(final int node);
079:
080: public String getNamespaceName(final int node);
081:
082: public int getExpandedTypeID(final int node);
083:
084: public int getNamespaceType(final int node);
085:
086: public int getParent(final int node);
087:
088: public int getAttributeNode(final int gType, final int element);
089:
090: public String getStringValueX(final int node);
091:
092: public void copy(final int node, SerializationHandler handler)
093: throws TransletException;
094:
095: public void copy(DTMAxisIterator nodes, SerializationHandler handler)
096: throws TransletException;
097:
098: public String shallowCopy(final int node,
099: SerializationHandler handler) throws TransletException;
100:
101: public boolean lessThan(final int node1, final int node2);
102:
103: public void characters(final int textNode,
104: SerializationHandler handler) throws TransletException;
105:
106: public Node makeNode(int index);
107:
108: public Node makeNode(DTMAxisIterator iter);
109:
110: public NodeList makeNodeList(int index);
111:
112: public NodeList makeNodeList(DTMAxisIterator iter);
113:
114: public String getLanguage(int node);
115:
116: public int getSize();
117:
118: public String getDocumentURI(int node);
119:
120: public void setFilter(StripFilter filter);
121:
122: public void setupMapping(String[] names, String[] urisArray,
123: int[] typesArray, String[] namespaces);
124:
125: public boolean isElement(final int node);
126:
127: public boolean isAttribute(final int node);
128:
129: public String lookupNamespace(int node, String prefix)
130: throws TransletException;
131:
132: public int getNodeIdent(final int nodehandle);
133:
134: public int getNodeHandle(final int nodeId);
135:
136: public DOM getResultTreeFrag(int initialSize, int rtfType);
137:
138: public DOM getResultTreeFrag(int initialSize, int rtfType,
139: boolean addToDTMManager);
140:
141: public SerializationHandler getOutputDomBuilder();
142:
143: public int getNSType(int node);
144:
145: public int getDocument();
146:
147: public String getUnparsedEntityURI(String name);
148:
149: public Hashtable getElementsWithIDs();
150: }
|