if( cursor.getName().getLocalPart().equals( name ) ) { // Found it... content = cursor.getTextValue().replaceAll( ">_;", ">" ).replaceAll( "<_;", "<" ) ; break ; } } else if( cursor.isStart() && cursor.getObject().schemaType() == SelectionListType.type ) { break ; } } // end while return content ; } finally { cursor.dispose(); } } // end of readProcessingInstruction }
protected ColumnReferenceType[] getColumnReferences(SelectDocument doc) throws QueryException { ArrayList colRefs = new ArrayList() ; // // Loop through the whole of the query looking for // ColumnReferenceType(s).... XmlCursor cursor = doc.newCursor() ; try { while( !cursor.toNextToken().isNone() ) { if( cursor.isStart() && (cursor.getObject().schemaType() == ColumnReferenceType.type )){ colRefs.add( cursor.getObject() ) ; } } // end while } catch( Exception ex ) { log.error("Warning: Failed to get all column references from SelectDocument; error was " + ex.toString()); throw new QueryException("Failed to get column references from SelectDocument", ex); } finally { cursor.dispose() ; } return (ColumnReferenceType[])colRefs.toArray( new ColumnReferenceType[ colRefs.size() ] ) ; }
if( log.isTraceEnabled() ) log.trace( "exit: WriteProcessingInstruction()" ) ;
if (!tt.isNone() && !tt.isEnd())
} else if (_toPrevToken().isNone()) { _cur.pop(); return null;
protected void changeNS (String oldURI, String newURI) { XmlCursor curs = newCursor(); while (curs.toParent()) { /* Goto the top of the document */ } TokenType tt = curs.currentTokenType(); if (tt.isStartdoc()) { tt = curs.toFirstContentToken(); } if (tt.isStart()) { do { if (tt.isStart() || tt.isAttr() || tt.isNamespace()) { javax.xml.namespace.QName currQName = curs.getName(); if (oldURI.equals(currQName.getNamespaceURI())) { curs.setName(new javax.xml.namespace.QName(newURI, currQName.getLocalPart())); } } tt = curs.toNextToken(); } while (!tt.isEnddoc() && !tt.isNone()); } curs.dispose(); }
} else if (_toPrevToken().isNone()) { _cur.pop(); return null;
public XmlBookmark _toNextBookmark(Object key) { if (key == null) return null; int cch; _cur.push(); for (; ;) { // Move a minimal amount. If at text, move to a potential bookmark in the text. if ((cch = _cur.cchRight()) > 1) { _cur.nextChars(1); _cur.nextChars((cch = _cur.firstBookmarkInChars(key, cch - 1)) >= 0 ? cch : -1); } else if (_toNextToken().isNone()) { _cur.pop(); return null; } XmlBookmark bm = getBookmark(key, _cur); if (bm != null) { _cur.popButStay(); return bm; } if (_cur.kind() == -ROOT) { _cur.pop(); return null; } } }
public XmlBookmark _toNextBookmark(Object key) { if (key == null) return null; int cch; _cur.push(); for (; ;) { // Move a minimal amount. If at text, move to a potential bookmark in the text. if ((cch = _cur.cchRight()) > 1) { _cur.nextChars(1); _cur.nextChars((cch = _cur.firstBookmarkInChars(key, cch - 1)) >= 0 ? cch : -1); } else if (_toNextToken().isNone()) { _cur.pop(); return null; } XmlBookmark bm = getBookmark(key, _cur); if (bm != null) { _cur.popButStay(); return bm; } if (_cur.kind() == -ROOT) { _cur.pop(); return null; } } }
cursor.push() ; } // // But we search for existing ones down to the SelectionList... else if( type == SelectionListType.type ) { break ; } } } // end while cursor.pop() ; cursor.insertProcInst( name, mangledContent ) ; } finally { cursor.dispose(); if( log.isTraceEnabled() ) log.trace( "exit: WriteProcessingInstruction()" ) ; } } // end of writeProcessingInstruction public static String ReadProcessingInstruction( SelectDocument doc, String name ) { String content = null ; XmlCursor cursor = doc.newCursor() ; try { while( !cursor.toNextToken().isNone() ) { if( cursor.isProcinst() ) {
private int distanceToRoot() { XmlCursor cur = _impl.newCursor(); int count = 0; while (!cur.toPrevToken().isNone()) { if (!cur.currentTokenType().isNamespace()) { count += 1; // System.out.println("Count: " + count + " " + cur.currentTokenType().toString() + " " + QName.pretty(cur.getName())); } } cur.dispose(); return count; }
private int distanceToRoot() { XmlCursor cur = _impl.newCursor(); int count = 0; while (!cur.toPrevToken().isNone()) { if (!cur.currentTokenType().isNamespace()) { count += 1; // System.out.println("Count: " + count + " " + cur.currentTokenType().toString() + " " + QName.pretty(cur.getName())); } } cur.dispose(); return count; }
} else if (_toPrevToken().isNone()) { _cur.pop(); return null;
public XmlBookmark _toNextBookmark(Object key) { if (key == null) return null; int cch; _cur.push(); for (; ;) { // Move a minimal amount. If at text, move to a potential bookmark in the text. if ((cch = _cur.cchRight()) > 1) { _cur.nextChars(1); _cur.nextChars((cch = _cur.firstBookmarkInChars(key, cch - 1)) >= 0 ? cch : -1); } else if (_toNextToken().isNone()) { _cur.pop(); return null; } XmlBookmark bm = getBookmark(key, _cur); if (bm != null) { _cur.popButStay(); return bm; } if (_cur.kind() == -ROOT) { _cur.pop(); return null; } } }
private int distanceToRoot() { XmlCursor cur = _impl.newCursor(); int count = 0; while (!cur.toPrevToken().isNone()) { if (!cur.currentTokenType().isNamespace()) { count += 1; // System.out.println("Count: " + count + " " + cur.currentTokenType().toString() + " " + QName.pretty(cur.getName())); } } cur.dispose(); return count; }