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
10
* http://www.apache.org/licenses/LICENSE-2.0
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.
19
* $Id: DTMManagerDefault.java,v 1.2 2009/12/10 03:18:39 matthewoliver Exp $
21
package org.apache.xml.dtm.ref;
23
import javax.xml.parsers.DocumentBuilder;
24
import javax.xml.parsers.DocumentBuilderFactory;
25
import javax.xml.transform.Source;
26
import javax.xml.transform.dom.DOMSource;
27
import javax.xml.transform.sax.SAXSource;
28
import javax.xml.transform.stream.StreamSource;
30
import org.apache.xml.dtm.DTM;
31
import org.apache.xml.dtm.DTMException;
32
import org.apache.xml.dtm.DTMFilter;
33
import org.apache.xml.dtm.DTMIterator;
34
import org.apache.xml.dtm.DTMManager;
35
import org.apache.xml.dtm.DTMWSFilter;
36
import org.apache.xml.dtm.ref.dom2dtm.DOM2DTM;
37
import org.apache.xml.dtm.ref.sax2dtm.SAX2DTM;
38
import org.apache.xml.dtm.ref.sax2dtm.SAX2RTFDTM;
39
import org.apache.xml.res.XMLErrorResources;
40
import org.apache.xml.res.XMLMessages;
41
import org.apache.xml.utils.PrefixResolver;
42
import org.apache.xml.utils.SystemIDResolver;
43
import org.apache.xml.utils.XMLReaderManager;
44
import org.apache.xml.utils.XMLStringFactory;
46
import org.w3c.dom.Document;
47
import org.w3c.dom.Node;
49
import org.xml.sax.InputSource;
50
import org.xml.sax.SAXException;
51
import org.xml.sax.SAXNotRecognizedException;
52
import org.xml.sax.SAXNotSupportedException;
53
import org.xml.sax.XMLReader;
54
import org.xml.sax.helpers.DefaultHandler;
57
* The default implementation for the DTMManager.
59
* %REVIEW% There is currently a reentrancy issue, since the finalizer
60
* for XRTreeFrag (which runs in the GC thread) wants to call
61
* DTMManager.release(), and may do so at the same time that the main
62
* transformation thread is accessing the manager. Our current solution is
63
* to make most of the manager's methods <code>synchronized</code>.
64
* Early tests suggest that doing so is not causing a significant
65
* performance hit in Xalan. However, it should be noted that there
66
* is a possible alternative solution: rewrite release() so it merely
67
* posts a request for release onto a threadsafe queue, and explicitly
68
* process that queue on an infrequent basis during main-thread
69
* activity (eg, when getDTM() is invoked). The downside of that solution
70
* would be a greater delay before the DTM's storage is actually released
73
public class DTMManagerDefault extends DTMManager
75
//static final boolean JKESS_XNI_EXPERIMENT=true;
77
/** Set this to true if you want a dump of the DTM after creation. */
78
private static final boolean DUMPTREE = false;
80
/** Set this to true if you want a basic diagnostics. */
81
private static final boolean DEBUG = false;
84
* Map from DTM identifier numbers to DTM objects that this manager manages.
85
* One DTM may have several prefix numbers, if extended node indexing
86
* is in use; in that case, m_dtm_offsets[] will used to control which
87
* prefix maps to which section of the DTM.
89
* This array grows as necessary; see addDTM().
91
* This array grows as necessary; see addDTM(). Growth is uncommon... but
92
* access needs to be blindingly fast since it's used in node addressing.
94
protected DTM m_dtms[] = new DTM[256];
96
/** Map from DTM identifier numbers to offsets. For small DTMs with a
97
* single identifier, this will always be 0. In overflow addressing, where
98
* additional identifiers are allocated to access nodes beyond the range of
99
* a single Node Handle, this table is used to map the handle's node field
100
* into the actual node identifier.
102
* This array grows as necessary; see addDTM().
104
* This array grows as necessary; see addDTM(). Growth is uncommon... but
105
* access needs to be blindingly fast since it's used in node addressing.
106
* (And at the moment, that includes accessing it from DTMDefaultBase,
107
* which is why this is not Protected or Private.)
109
int m_dtm_offsets[] = new int[256];
112
* The cache for XMLReader objects to be used if the user did not
113
* supply an XMLReader for a SAXSource or supplied a StreamSource.
115
protected XMLReaderManager m_readerManager = null;
118
* The default implementation of ContentHandler, DTDHandler and ErrorHandler.
120
protected DefaultHandler m_defaultHandler = new DefaultHandler();
123
* Add a DTM to the DTM table. This convenience call adds it as the
124
* "base DTM ID", with offset 0. The other version of addDTM should
125
* be used if you want to add "extended" DTM IDs with nonzero offsets.
127
* @param dtm Should be a valid reference to a DTM.
128
* @param id Integer DTM ID to be bound to this DTM
130
synchronized public void addDTM(DTM dtm, int id) { addDTM(dtm,id,0); }
134
* Add a DTM to the DTM table.
136
* @param dtm Should be a valid reference to a DTM.
137
* @param id Integer DTM ID to be bound to this DTM.
138
* @param offset Integer addressing offset. The internal DTM Node ID is
139
* obtained by adding this offset to the node-number field of the
140
* public DTM Handle. For the first DTM ID accessing each DTM, this is 0;
141
* for overflow addressing it will be a multiple of 1<<IDENT_DTM_NODE_BITS.
143
synchronized public void addDTM(DTM dtm, int id, int offset)
145
if(id>=IDENT_MAX_DTMS)
147
// TODO: %REVIEW% Not really the right error message.
148
throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null)); //"No more DTM IDs are available!");
151
// We used to just allocate the array size to IDENT_MAX_DTMS.
152
// But we expect to increase that to 16 bits, and I'm not willing
153
// to allocate that much space unless needed. We could use one of our
154
// handy-dandy Fast*Vectors, but this will do for now.
156
int oldlen=m_dtms.length;
159
// Various growth strategies are possible. I think we don't want
160
// to over-allocate excessively, and I'm willing to reallocate
161
// more often to get that. See also Fast*Vector classes.
163
// %REVIEW% Should throw a more diagnostic error if we go over the max...
164
int newlen=Math.min((id+256),IDENT_MAX_DTMS);
166
DTM new_m_dtms[] = new DTM[newlen];
167
System.arraycopy(m_dtms,0,new_m_dtms,0,oldlen);
169
int new_m_dtm_offsets[] = new int[newlen];
170
System.arraycopy(m_dtm_offsets,0,new_m_dtm_offsets,0,oldlen);
171
m_dtm_offsets=new_m_dtm_offsets;
175
m_dtm_offsets[id]=offset;
176
dtm.documentRegistration();
177
// The DTM should have been told who its manager was when we created it.
178
// Do we need to allow for adopting DTMs _not_ created by this manager?
182
* Get the first free DTM ID available. %OPT% Linear search is inefficient!
184
synchronized public int getFirstFreeDTMID()
186
int n = m_dtms.length;
187
for (int i = 1; i < n; i++)
189
if(null == m_dtms[i])
194
return n; // count on addDTM() to throw exception if out of range
198
* The default table for exandedNameID lookups.
200
private ExpandedNameTable m_expandedNameTable =
201
new ExpandedNameTable();
204
* Constructor DTMManagerDefault
207
public DTMManagerDefault(){}
211
* Get an instance of a DTM, loaded with the content from the
212
* specified source. If the unique flag is true, a new instance will
213
* always be returned. Otherwise it is up to the DTMManager to return a
214
* new instance or an instance that it already created and may be being used
217
* A bit of magic in this implementation: If the source is null, unique is true,
218
* and incremental and doIndexing are both false, we return an instance of
219
* SAX2RTFDTM, which see.
221
* (I think more parameters will need to be added for error handling, and entity
222
* resolution, and more explicit control of the RTF situation).
224
* @param source the specification of the source object.
225
* @param unique true if the returned DTM must be unique, probably because it
226
* is going to be mutated.
227
* @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
229
* @param incremental true if the DTM should be built incrementally, if
231
* @param doIndexing true if the caller considers it worth it to use
234
* @return a non-null DTM reference.
236
synchronized public DTM getDTM(Source source, boolean unique,
237
DTMWSFilter whiteSpaceFilter,
238
boolean incremental, boolean doIndexing)
241
if(DEBUG && null != source)
242
System.out.println("Starting "+
243
(unique ? "UNIQUE" : "shared")+
244
" source: "+source.getSystemId()
247
XMLStringFactory xstringFactory = m_xsf;
248
int dtmPos = getFirstFreeDTMID();
249
int documentID = dtmPos << IDENT_DTM_NODE_BITS;
251
if ((null != source) && source instanceof DOMSource)
253
DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID,
254
whiteSpaceFilter, xstringFactory, doIndexing);
256
addDTM(dtm, dtmPos, 0);
267
boolean isSAXSource = (null != source)
268
? (source instanceof SAXSource) : true;
269
boolean isStreamSource = (null != source)
270
? (source instanceof StreamSource) : false;
272
if (isSAXSource || isStreamSource) {
273
XMLReader reader = null;
277
InputSource xmlSource;
279
if (null == source) {
282
reader = getXMLReader(source);
283
xmlSource = SAXSource.sourceToInputSource(source);
285
String urlOfSource = xmlSource.getSystemId();
287
if (null != urlOfSource) {
289
urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource);
290
} catch (Exception e) {
291
// %REVIEW% Is there a better way to send a warning?
292
System.err.println("Can not absolutize URL: " + urlOfSource);
295
xmlSource.setSystemId(urlOfSource);
299
if (source==null && unique && !incremental && !doIndexing) {
300
// Special case to support RTF construction into shared DTM.
301
// It should actually still work for other uses,
302
// but may be slightly deoptimized relative to the base
303
// to allow it to deal with carrying multiple documents.
305
// %REVIEW% This is a sloppy way to request this mode;
306
// we need to consider architectural improvements.
307
dtm = new SAX2RTFDTM(this, source, documentID, whiteSpaceFilter,
308
xstringFactory, doIndexing);
310
/**************************************************************
311
// EXPERIMENTAL 3/22/02
312
else if(JKESS_XNI_EXPERIMENT && m_incremental) {
313
dtm = new XNI2DTM(this, source, documentID, whiteSpaceFilter,
314
xstringFactory, doIndexing);
316
**************************************************************/
317
// Create the basic SAX2DTM.
319
dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter,
320
xstringFactory, doIndexing);
323
// Go ahead and add the DTM to the lookup table. This needs to be
324
// done before any parsing occurs. Note offset 0, since we've just
325
// created a new DTM.
326
addDTM(dtm, dtmPos, 0);
329
boolean haveXercesParser =
331
&& (reader.getClass()
333
.equals("org.apache.xerces.parsers.SAXParser") );
335
if (haveXercesParser) {
336
incremental = true; // No matter what. %REVIEW%
339
// If the reader is null, but they still requested an incremental
340
// build, then we still want to set up the IncrementalSAXSource stuff.
341
if (m_incremental && incremental
342
/* || ((null == reader) && incremental) */) {
343
IncrementalSAXSource coParser=null;
345
if (haveXercesParser) {
346
// IncrementalSAXSource_Xerces to avoid threading.
348
coParser =(IncrementalSAXSource)
349
Class.forName("org.apache.xml.dtm.ref.IncrementalSAXSource_Xerces").newInstance();
350
} catch( Exception ex ) {
351
ex.printStackTrace();
356
if (coParser==null ) {
357
// Create a IncrementalSAXSource to run on the secondary thread.
358
if (null == reader) {
359
coParser = new IncrementalSAXSource_Filter();
361
IncrementalSAXSource_Filter filter =
362
new IncrementalSAXSource_Filter();
363
filter.setXMLReader(reader);
369
/**************************************************************
370
// EXPERIMENTAL 3/22/02
371
if (JKESS_XNI_EXPERIMENT && m_incremental &&
372
dtm instanceof XNI2DTM &&
373
coParser instanceof IncrementalSAXSource_Xerces) {
374
org.apache.xerces.xni.parser.XMLPullParserConfiguration xpc=
375
((IncrementalSAXSource_Xerces)coParser)
376
.getXNIParserConfiguration();
378
// Bypass SAX; listen to the XNI stream
379
((XNI2DTM)dtm).setIncrementalXNISource(xpc);
381
// Listen to the SAX stream (will fail, diagnostically...)
382
dtm.setIncrementalSAXSource(coParser);
385
***************************************************************/
387
// Have the DTM set itself up as IncrementalSAXSource's listener.
388
dtm.setIncrementalSAXSource(coParser);
390
if (null == xmlSource) {
392
// Then the user will construct it themselves.
396
if (null == reader.getErrorHandler()) {
397
reader.setErrorHandler(dtm);
399
reader.setDTDHandler(dtm);
402
// Launch parsing coroutine. Launches a second thread,
403
// if we're using IncrementalSAXSource.filter().
405
coParser.startParse(xmlSource);
406
} catch (RuntimeException re) {
408
dtm.clearCoRoutine();
411
} catch (Exception e) {
413
dtm.clearCoRoutine();
415
throw new org.apache.xml.utils.WrappedRuntimeException(e);
418
if (null == reader) {
420
// Then the user will construct it themselves.
425
reader.setContentHandler(dtm);
426
reader.setDTDHandler(dtm);
427
if (null == reader.getErrorHandler()) {
428
reader.setErrorHandler(dtm);
433
"http://xml.org/sax/properties/lexical-handler",
435
} catch (SAXNotRecognizedException e){}
436
catch (SAXNotSupportedException e){}
439
reader.parse(xmlSource);
440
} catch (RuntimeException re) {
441
dtm.clearCoRoutine();
444
} catch (Exception e) {
445
dtm.clearCoRoutine();
447
throw new org.apache.xml.utils.WrappedRuntimeException(e);
452
System.out.println("Dumping SAX2DOM");
453
dtm.dumpDTM(System.err);
458
// Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler
459
// after creating the DTM.
460
if (reader != null && !(m_incremental && incremental)) {
461
reader.setContentHandler(m_defaultHandler);
462
reader.setDTDHandler(m_defaultHandler);
463
reader.setErrorHandler(m_defaultHandler);
465
// Reset the LexicalHandler to null after creating the DTM.
467
reader.setProperty("http://xml.org/sax/properties/lexical-handler", null);
469
catch (Exception e) {}
471
releaseXMLReader(reader);
475
// It should have been handled by a derived class or the caller
477
throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source);
483
* Given a W3C DOM node, try and return a DTM handle.
484
* Note: calling this may be non-optimal, and there is no guarantee that
485
* the node will be found in any particular DTM.
487
* @param node Non-null reference to a DOM node.
489
* @return a valid DTM handle.
491
synchronized public int getDTMHandleFromNode(org.w3c.dom.Node node)
494
throw new IllegalArgumentException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!");
496
if (node instanceof org.apache.xml.dtm.ref.DTMNodeProxy)
497
return ((org.apache.xml.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber();
501
// Find the DOM2DTMs wrapped around this Document (if any)
502
// and check whether they contain the Node in question.
504
// NOTE that since a DOM2DTM may represent a subtree rather
505
// than a full document, we have to be prepared to check more
506
// than one -- and there is no guarantee that we will find
507
// one that contains ancestors or siblings of the node we're
510
// %REVIEW% We could search for the one which contains this
511
// node at the deepest level, and thus covers the widest
512
// subtree, but that's going to entail additional work
513
// checking more DTMs... and getHandleOfNode is not a
514
// cheap operation in most implementations.
516
// TODO: %REVIEW% If overflow addressing, we may recheck a DTM
517
// already examined. Ouch. But with the increased number of DTMs,
518
// scanning back to check this is painful.
519
// POSSIBLE SOLUTIONS:
520
// Generate a list of _unique_ DTM objects?
521
// Have each DTM cache last DOM node search?
522
int max = m_dtms.length;
523
for(int i = 0; i < max; i++)
525
DTM thisDTM=m_dtms[i];
526
if((null != thisDTM) && thisDTM instanceof DOM2DTM)
528
int handle=((DOM2DTM)thisDTM).getHandleOfNode(node);
529
if(handle!=DTM.NULL) return handle;
533
// Not found; generate a new DTM.
535
// %REVIEW% Is this really desirable, or should we return null
536
// and make folks explicitly instantiate from a DOMSource? The
537
// latter is more work but gives the caller the opportunity to
538
// explicitly add the DTM to a DTMManager... and thus to know when
539
// it can be discarded again, which is something we need to pay much
540
// more attention to. (Especially since only DTMs which are assigned
541
// to a manager can use the overflow addressing scheme.)
543
// %BUG% If the source node was a DOM2DTM$defaultNamespaceDeclarationNode
544
// and the DTM wasn't registered with this DTMManager, we will create
545
// a new DTM and _still_ not be able to find the node (since it will
546
// be resynthesized). Another reason to push hard on making all DTMs
549
// Since the real root of our tree may be a DocumentFragment, we need to
550
// use getParent to find the root, instead of getOwnerDocument. Otherwise
551
// DOM2DTM#getHandleOfNode will be very unhappy.
553
Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ? ((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode();
554
for (; p != null; p = p.getParentNode())
559
DOM2DTM dtm = (DOM2DTM) getDTM(new javax.xml.transform.dom.DOMSource(root),
560
false, null, true, true);
564
if(node instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode)
566
// Can't return the same node since it's unique to a specific DTM,
567
// but can return the equivalent node -- find the corresponding
568
// Document Element, then ask it for the xml: namespace decl.
569
handle=dtm.getHandleOfNode(((org.w3c.dom.Attr)node).getOwnerElement());
570
handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName());
573
handle = ((DOM2DTM)dtm).getHandleOfNode(node);
575
if(DTM.NULL == handle)
576
throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!");
583
* This method returns the SAX2 parser to use with the InputSource
584
* obtained from this URI.
585
* It may return null if any SAX2-conformant XML parser can be used,
586
* or if getInputSource() will also return null. The parser must
587
* be free for use (i.e., not currently in use for another parse().
588
* After use of the parser is completed, the releaseXMLReader(XMLReader)
591
* @param inputSource The value returned from the URIResolver.
592
* @return a SAX2 XMLReader to use to resolve the inputSource argument.
594
* @return non-null XMLReader reference ready to parse.
596
synchronized public XMLReader getXMLReader(Source inputSource)
601
XMLReader reader = (inputSource instanceof SAXSource)
602
? ((SAXSource) inputSource).getXMLReader() : null;
604
// If user did not supply a reader, ask for one from the reader manager
605
if (null == reader) {
606
if (m_readerManager == null) {
607
m_readerManager = XMLReaderManager.getInstance();
610
reader = m_readerManager.getXMLReader();
615
} catch (SAXException se) {
616
throw new DTMException(se.getMessage(), se);
621
* Indicates that the XMLReader object is no longer in use for the transform.
623
* Note that the getXMLReader method may return an XMLReader that was
624
* specified on the SAXSource object by the application code. Such a
625
* reader should still be passed to releaseXMLReader, but the reader manager
626
* will only re-use XMLReaders that it created.
628
* @param reader The XMLReader to be released.
630
synchronized public void releaseXMLReader(XMLReader reader) {
631
if (m_readerManager != null) {
632
m_readerManager.releaseXMLReader(reader);
637
* Return the DTM object containing a representation of this node.
639
* @param nodeHandle DTM Handle indicating which node to retrieve
641
* @return a reference to the DTM object containing this node.
643
synchronized public DTM getDTM(int nodeHandle)
647
// Performance critical function.
648
return m_dtms[nodeHandle >>> IDENT_DTM_NODE_BITS];
650
catch(java.lang.ArrayIndexOutOfBoundsException e)
652
if(nodeHandle==DTM.NULL)
653
return null; // Accept as a special case.
655
throw e; // Programming error; want to know about it.
660
* Given a DTM, find the ID number in the DTM tables which addresses
661
* the start of the document. If overflow addressing is in use, other
662
* DTM IDs may also be assigned to this DTM.
664
* @param dtm The DTM which (hopefully) contains this node.
666
* @return The DTM ID (as the high bits of a NodeHandle, not as our
667
* internal index), or -1 if the DTM doesn't belong to this manager.
669
synchronized public int getDTMIdentity(DTM dtm)
671
// Shortcut using DTMDefaultBase's extension hooks
672
// %REVIEW% Should the lookup be part of the basic DTM API?
673
if(dtm instanceof DTMDefaultBase)
675
DTMDefaultBase dtmdb=(DTMDefaultBase)dtm;
676
if(dtmdb.getManager()==this)
677
return dtmdb.getDTMIDs().elementAt(0);
682
int n = m_dtms.length;
684
for (int i = 0; i < n; i++)
686
DTM tdtm = m_dtms[i];
688
if (tdtm == dtm && m_dtm_offsets[i]==0)
689
return i << IDENT_DTM_NODE_BITS;
696
* Release the DTMManager's reference(s) to a DTM, making it unmanaged.
697
* This is typically done as part of returning the DTM to the heap after
698
* we're done with it.
700
* @param dtm the DTM to be released.
702
* @param shouldHardDelete If false, this call is a suggestion rather than an
703
* order, and we may not actually release the DTM. This is intended to
704
* support intelligent caching of documents... which is not implemented
705
* in this version of the DTM manager.
707
* @return true if the DTM was released, false if shouldHardDelete was set
708
* and we decided not to.
710
synchronized public boolean release(DTM dtm, boolean shouldHardDelete)
714
System.out.println("Releasing "+
715
(shouldHardDelete ? "HARD" : "soft")+
717
// Following shouldn't need a nodeHandle, but does...
718
// and doesn't seem to report the intended value
719
dtm.getDocumentBaseURI()
723
if (dtm instanceof SAX2DTM)
725
((SAX2DTM) dtm).clearCoRoutine();
728
// Multiple DTM IDs may be assigned to a single DTM.
729
// The Right Answer is to ask which (if it supports
730
// extension, the DTM will need a list anyway). The
731
// Wrong Answer, applied if the DTM can't help us,
732
// is to linearly search them all; this may be very
735
// %REVIEW% Should the lookup move up into the basic DTM API?
736
if(dtm instanceof DTMDefaultBase)
738
org.apache.xml.utils.SuballocatedIntVector ids=((DTMDefaultBase)dtm).getDTMIDs();
739
for(int i=ids.size()-1;i>=0;--i)
740
m_dtms[ids.elementAt(i)>>>DTMManager.IDENT_DTM_NODE_BITS]=null;
744
int i = getDTMIdentity(dtm);
747
m_dtms[i >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
751
dtm.documentRelease();
756
* Method createDocumentFragment
759
* NEEDSDOC (createDocumentFragment) @return
761
synchronized public DTM createDocumentFragment()
766
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
768
dbf.setNamespaceAware(true);
770
DocumentBuilder db = dbf.newDocumentBuilder();
771
Document doc = db.newDocument();
772
Node df = doc.createDocumentFragment();
774
return getDTM(new DOMSource(df), true, null, false, false);
778
throw new DTMException(e);
783
* NEEDSDOC Method createDTMIterator
786
* NEEDSDOC @param whatToShow
787
* NEEDSDOC @param filter
788
* NEEDSDOC @param entityReferenceExpansion
790
* NEEDSDOC (createDTMIterator) @return
792
synchronized public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter,
793
boolean entityReferenceExpansion)
796
/** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
801
* NEEDSDOC Method createDTMIterator
804
* NEEDSDOC @param xpathString
805
* NEEDSDOC @param presolver
807
* NEEDSDOC (createDTMIterator) @return
809
synchronized public DTMIterator createDTMIterator(String xpathString,
810
PrefixResolver presolver)
813
/** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
818
* NEEDSDOC Method createDTMIterator
821
* NEEDSDOC @param node
823
* NEEDSDOC (createDTMIterator) @return
825
synchronized public DTMIterator createDTMIterator(int node)
828
/** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
833
* NEEDSDOC Method createDTMIterator
836
* NEEDSDOC @param xpathCompiler
837
* NEEDSDOC @param pos
839
* NEEDSDOC (createDTMIterator) @return
841
synchronized public DTMIterator createDTMIterator(Object xpathCompiler, int pos)
844
/** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */
849
* return the expanded name table.
851
* NEEDSDOC @param dtm
853
* NEEDSDOC ($objectName$) @return
855
public ExpandedNameTable getExpandedNameTable(DTM dtm)
857
return m_expandedNameTable;