本文整理汇总了Java中com.sun.org.apache.xerces.internal.util.XMLChar.isName方法的典型用法代码示例。如果您正苦于以下问题:Java XMLChar.isName方法的具体用法?Java XMLChar.isName怎么用?Java XMLChar.isName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xerces.internal.util.XMLChar
的用法示例。
在下文中一共展示了XMLChar.isName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: skipQElement
import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的package包/类
boolean skipQElement(String rawname) throws IOException{
final int c = fEntityScanner.getChar(rawname.length());
//if this character is still valid element name -- this means string can't match
if(XMLChar.isName(c)){
return false;
}else{
return fEntityScanner.skipString(rawname);
}
}
示例2: next
import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的package包/类
public int next() throws IOException, XNIException {
if(DEBUG_NEXT){
System.out.println("NOW IN XMLDeclDriver");
}
// next driver is prolog regardless of whether there
// is an XMLDecl in this document
setScannerState(SCANNER_STATE_PROLOG);
setDriver(fPrologDriver);
//System.out.println("fEntityScanner = " + fEntityScanner);
// scan XMLDecl
try {
if (fEntityScanner.skipString(xmlDecl)) {
fMarkupDepth++;
// NOTE: special case where document starts with a PI
// whose name starts with "xml" (e.g. "xmlfoo")
if (XMLChar.isName(fEntityScanner.peekChar())) {
fStringBuffer.clear();
fStringBuffer.append("xml");
while (XMLChar.isName(fEntityScanner.peekChar())) {
fStringBuffer.append((char)fEntityScanner.scanChar());
}
String target = fSymbolTable.addSymbol(fStringBuffer.ch, fStringBuffer.offset, fStringBuffer.length);
//this function should fill the data.. and set the fEvent object to this event.
fContentBuffer.clear() ;
scanPIData(target, fContentBuffer);
//REVISIT:where else we can set this value to 'true'
fEntityManager.fCurrentEntity.mayReadChunks = true;
//return PI event since PI was encountered
return XMLEvent.PROCESSING_INSTRUCTION ;
}
// standard XML declaration
else {
scanXMLDeclOrTextDecl(false);
//REVISIT:where else we can set this value to 'true'
fEntityManager.fCurrentEntity.mayReadChunks = true;
return XMLEvent.START_DOCUMENT;
}
} else{
//REVISIT:where else we can set this value to 'true'
fEntityManager.fCurrentEntity.mayReadChunks = true;
//In both case return the START_DOCUMENT. ony difference is that first block will
//cosume the XML declaration if any.
return XMLEvent.START_DOCUMENT;
}
//START_OF_THE_DOCUMENT
}
// premature end of file
catch (EOFException e) {
reportFatalError("PrematureEOF", null);
return -1;
//throw e;
}
}
示例3: isValidNameChar
import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的package包/类
protected boolean isValidNameChar(int value) {
return (XMLChar.isName(value));
}