public String getDocumentURI() { if (_enhancedDOM != null) { return _enhancedDOM.getDocumentURI(); } else { return ""; } }
/** * Return an IntegerArray for the DOM Node which has the given id. * * @param id The id * @return A IntegerArray representing the Node whose id is the given value. */ public IntegerArray getDOMNodeById(String id) { IntegerArray nodes = null; if (_enhancedDOM != null) { int ident = _enhancedDOM.getElementById(id); if (ident != DTM.NULL) { Integer root = new Integer(_enhancedDOM.getDocument()); Hashtable index = (Hashtable) _rootToIndexMap.get(root); if (index == null) { index = new Hashtable(); _rootToIndexMap.put(root, index); } else { nodes = (IntegerArray) index.get(id); } if (nodes == null) { nodes = new IntegerArray(); index.put(id, nodes); } nodes.add(_enhancedDOM.getNodeHandle(ident)); } } return nodes; }
public int getExpandedTypeID(final int node) { final short[] mapping = getMapping(); final int type; if (_enhancedDOM != null) { type = mapping[_enhancedDOM.getExpandedTypeID2(node)]; } else { if(null != mapping) { type = mapping[_dom.getExpandedTypeID(node)]; } else { type = _dom.getExpandedTypeID(node); } } return type; }
if (enhancedDOM.hasDOMSource()) { buildKeyIndex(ID_INDEX_NAME, document); return; final Hashtable elementsByID = enhancedDOM.getElementsWithIDs();
mapping = (short[])m_mappings.get(dtm); if (mapping == null) { mapping = mappableDOM.getMapping( m_translet.getNamesArray(), m_translet.getUrisArray(), int expType = mappableDOM.getExpandedTypeID(node);
public void setDocumentURI(String uri) { if (_enhancedDOM != null) { _enhancedDOM.setDocumentURI(uri); } }
/** * This method must be called by the code generated by the id() function * prior to returning the node iterator. The lookup code for key() and * id() differ in the way the lookup value can be whitespace separated * list of tokens for the id() function, but a single string for the * key() function. * @deprecated */ public void lookupId(Object value) { // Clear _nodes array _nodes = null; final StringTokenizer values = new StringTokenizer((String) value, " \n\t"); while (values.hasMoreElements()) { final String token = (String) values.nextElement(); IntegerArray nodes = (IntegerArray) _index.get(token); if (nodes == null && _enhancedDOM != null && _enhancedDOM.hasDOMSource()) { nodes = getDOMNodeById(token); } if (nodes == null) continue; if (_nodes == null) { nodes = (IntegerArray)nodes.clone(); _nodes = nodes; } else { _nodes.merge(nodes); } } }
private short[] getMapping() { if (_mapping == null) { if (_enhancedDOM != null) { _mapping = _enhancedDOM.getMapping(_namesArray, _urisArray, _typesArray); } } return _mapping; }
if (newDom instanceof DOMEnhancedForDTM) { return new SingletonIterator(((DOMEnhancedForDTM)newDom) .getDocument(), true); enhancedDOM.setDocumentURI(uri);
private int[] getReverse() { if (_reverse == null) { if (_enhancedDOM != null) { _reverse = _enhancedDOM.getReverseMapping(_namesArray, _urisArray, _typesArray); } } return _reverse; }
private short[] getNSReverse() { if (_NSreverse == null) { if (_enhancedDOM != null) { _NSreverse = _enhancedDOM .getReverseNamespaceMapping(_namespaceArray); } } return _NSreverse; }
private short[] getNSMapping() { if (_NSmapping == null) { if (_enhancedDOM != null) { _NSmapping = _enhancedDOM.getNamespaceMapping(_namespaceArray); } } return _NSmapping; }
/** * Return an IntegerArray for the DOM Node which has the given id. * * @param id The id * @return A IntegerArray representing the Node whose id is the given value. */ public IntegerArray getDOMNodeById(String id) { IntegerArray nodes = null; if (_enhancedDOM != null) { int ident = _enhancedDOM.getElementById(id); if (ident != DTM.NULL) { Integer root = new Integer(_enhancedDOM.getDocument()); Hashtable index = (Hashtable) _rootToIndexMap.get(root); if (index == null) { index = new Hashtable(); _rootToIndexMap.put(root, index); } else { nodes = (IntegerArray) index.get(id); } if (nodes == null) { nodes = new IntegerArray(); index.put(id, nodes); } nodes.add(_enhancedDOM.getNodeHandle(ident)); } } return nodes; }
public void characters(final int textNode, SerializationHandler handler) throws TransletException { if (_enhancedDOM != null) { _enhancedDOM.characters(textNode, handler); } else { _dom.characters(textNode, handler); } }
/** * Loads the document and updates build-time (latency) statistics */ public void loadDocument(String uri) { try { final long stamp = System.currentTimeMillis(); _dom = (DOMEnhancedForDTM)_dtmManager.getDTM( new SAXSource(_reader, new InputSource(uri)), false, null, true, false); _dom.setDocumentURI(uri); // The build time can be used for statistics for a better // priority algorithm (currently round robin). final long thisTime = System.currentTimeMillis() - stamp; if (_buildTime > 0) _buildTime = (_buildTime + thisTime) >>> 1; else _buildTime = thisTime; } catch (Exception e) { _dom = null; } }
&& _enhancedDOM.hasDOMSource()) { nodes = getDOMNodeById(token);
private short[] getMapping() { if (_mapping == null) { if (_enhancedDOM != null) { _mapping = _enhancedDOM.getMapping(_namesArray, _urisArray, _typesArray); } } return _mapping; }
if (enhancedDOM.hasDOMSource()) { buildKeyIndex(ID_INDEX_NAME, document); return; final Hashtable elementsByID = enhancedDOM.getElementsWithIDs();
mapping = (short[])m_mappings.get(dtm); if (mapping == null) { mapping = mappableDOM.getMapping( m_translet.getNamesArray(), m_translet.getUrisArray(), int expType = mappableDOM.getExpandedTypeID(node);
if (newDom instanceof DOMEnhancedForDTM) { return new SingletonIterator(((DOMEnhancedForDTM)newDom) .getDocument(), true); enhancedDOM.setDocumentURI(uri);