javax.xml.namespace.QName targetProperty = new javax.xml.namespace.QName(namespace, "*"); if (tt.isStartdoc())
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(); }
javax.xml.namespace.QName targetProperty = qname; if (tt.isStartdoc())
if (curs.currentTokenType().isStartdoc())
index = curs.currentTokenType().isStartdoc() ? -1 : index;
if (!fUseStartDoc && curs.currentTokenType().isStartdoc())
XmlCursor xmlChildCursor = childToMatch.newCursor(); if (tt.isStartdoc())
if (curs.currentTokenType().isStartdoc())
if (srcCurs.currentTokenType().isStartdoc())
if (destCurs.currentTokenType().isStartdoc())
/** * * @param name * @return */ private XMLList matchAttributes(XMLName xmlName) { XMLList result = new XMLList(lib); XmlCursor curs = newCursor(); if (curs.currentTokenType().isStartdoc()) { curs.toFirstContentToken(); } if (curs.isStart()) { if (curs.toFirstAttribute()) { do { if (qnameMatches(xmlName, curs.getName())) { result.addToList(createAttributeObject(curs)); } } while (curs.toNextAttribute()); } } curs.dispose(); return result; }
/** * */ void remove () { XmlCursor childCurs = newCursor(); if (childCurs.currentTokenType().isStartdoc()) { // Remove on the document removes all children. TokenType tt = childCurs.toFirstContentToken(); while (!tt.isEnd() && !tt.isEnddoc()) { removeToken(childCurs); tt = childCurs.currentTokenType(); // Now see where we're pointing after the delete -- next token. } } else { removeToken(childCurs); } childCurs.dispose(); }
static XML createFromXmlObject(XMLLibImpl lib, XmlObject xo) { XScriptAnnotation anno; XmlCursor curs = xo.newCursor(); if (curs.currentTokenType().isStartdoc()) { curs.toFirstContentToken(); } try { anno = new XScriptAnnotation(curs); curs.setBookmark(anno); } finally { curs.dispose(); } return new XML(lib, anno); }
private static XML createXML (XMLLibImpl lib, XmlCursor curs) { if (curs.currentTokenType().isStartdoc()) { curs.toFirstContentToken(); } XScriptAnnotation anno = findAnnotation(curs); return new XML(lib, anno); }