org.apache.xml.utils.XML11Char.isXML11ValidQName()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中org.apache.xml.utils.XML11Char.isXML11ValidQName()方法的一些代码示例,展示了XML11Char.isXML11ValidQName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XML11Char.isXML11ValidQName()方法的具体详情如下:
包路径:org.apache.xml.utils.XML11Char
类名称:XML11Char
方法名:isXML11ValidQName

XML11Char.isXML11ValidQName介绍

[英]Simple check to determine if qname is legal. If it returns false then str is illegal; if it returns true then str is legal.
[中]简单检查以确定qname是否合法。如果返回false,则str是非法的;如果返回true,则str是合法的。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Validate that the node name is good.
 * 
 * @param nodeName Name of the node being constructed, which may be null.
 * 
 * @return true if the node name is valid, false otherwise.
 */
 protected boolean validateNodeName(String nodeName)
 {
  if(null == nodeName)
   return false;
  if(nodeName.equals("xmlns"))
   return false;
  return XML11Char.isXML11ValidQName(nodeName);
 }

代码示例来源:origin: xalan/xalan

/**
 * Validate that the node name is good.
 * 
 * @param nodeName Name of the node being constructed, which may be null.
 * 
 * @return true if the node name is valid, false otherwise.
 */
 protected boolean validateNodeName(String nodeName)
 {
  if(null == nodeName)
   return false;
  if(nodeName.equals("xmlns"))
   return false;
  return XML11Char.isXML11ValidQName(nodeName);
 }

代码示例来源:origin: xalan/xalan

/**
 * Checks if the string is valid list of qnames
 */
public static boolean isValidQNames(String str) {
  if ((str != null) && (!str.equals(Constants.EMPTYSTRING))) {
    final StringTokenizer tokens = new StringTokenizer(str);
    while (tokens.hasMoreTokens()) {
      if (!XML11Char.isXML11ValidQName(tokens.nextToken())) {
        return false;
      }
    }
  }
  return true;
}

代码示例来源:origin: xalan/xalan

/**
 * Utility function to check if a name is a valid qname
 * This method should only be invoked if the attribute value is an AVT
 */    
public static void checkQName(String name) {
  if (!XML11Char.isXML11ValidQName(name)) {
    runTimeError(INVALID_QNAME_ERR,name); 
  }  
}

代码示例来源:origin: xalan/xalan

public void parseContents(Parser parser) {
  final String name = getAttribute("name");
  if (name.length() > 0) {
    if (!XML11Char.isXML11ValidQName(name)) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
      parser.reportError(Constants.ERROR, err);           
    }                
    _name = parser.getQNameIgnoreDefaultNs(name);
  }
  else {
    reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");		
  }
parseChildren(parser);
}

代码示例来源:origin: xalan/xalan

(_method.equals("html"))||
  (_method.equals("text"))||
  ((XML11Char.isXML11ValidQName(_method)&&(_method.indexOf(":") > 0)))) {
outputProperties.setProperty(OutputKeys.METHOD, _method);
} else {
  if (!XML11Char.isXML11ValidQName(qname)) {
    ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, qname, this);
    parser.reportError(Constants.ERROR, err);

代码示例来源:origin: xalan/xalan

public void parseContents(Parser parser) {
final String select = getAttribute("select");
final String mode   = getAttribute("mode");

if (select.length() > 0) {
  _select = parser.parseExpression(this, "select", null);
}

if (mode.length() > 0) {
    if (!XML11Char.isXML11ValidQName(mode)) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, mode, this);
      parser.reportError(Constants.ERROR, err);           
    }        
  _modeName = parser.getQNameIgnoreDefaultNs(mode);
}

// instantiate Mode if needed, cache (apply temp) function name
_functionName =
  parser.getTopLevelStylesheet().getMode(_modeName).functionName();
parseChildren(parser);// with-params
}

代码示例来源:origin: xalan/xalan

/**
 * The contents of a <xsl:with-param> elements are either in the element's
 * 'select' attribute (this has precedence) or in the element body.
 */
public void parseContents(Parser parser) {
final String name = getAttribute("name");
if (name.length() > 0) {
    if (!XML11Char.isXML11ValidQName(name)) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name,
                    this);
      parser.reportError(Constants.ERROR, err);
    }
  setName(parser.getQNameIgnoreDefaultNs(name));
}
  else {
  reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");
  }

final String select = getAttribute("select");
if (select.length() > 0) {
  _select = parser.parseExpression(this, "select", null);
}

parseChildren(parser);
}

代码示例来源:origin: xalan/xalan

/**
 * Parse the name of the <xsl:decimal-formatting/> element
 */
public void parseContents(Parser parser) {
// Get the name of these decimal formatting symbols
  final String name = getAttribute("name");
  if (name.length() > 0) {
    if (!XML11Char.isXML11ValidQName(name)){
      ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
      parser.reportError(Constants.ERROR, err);           
    }
  }
  _name = parser.getQNameIgnoreDefaultNs(name);
  if (_name == null) {
    _name = parser.getQNameIgnoreDefaultNs(EMPTYSTRING);
  }         
// Check if a set of symbols has already been registered under this name
SymbolTable stable = parser.getSymbolTable();
if (stable.getDecimalFormatting(_name) != null) {
  reportWarning(this, parser, ErrorMsg.SYMBOLS_REDEF_ERR,
  _name.toString());
}
else {
  stable.addDecimalFormatting(_name, this);
}
}

代码示例来源:origin: xalan/xalan

if (!XML11Char.isXML11ValidQName(name)) {
  ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
  parser.reportError(Constants.ERROR, err);           
if (!XML11Char.isXML11ValidQName(mode)) {
  ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, mode, this);
  parser.reportError(Constants.ERROR, err);

代码示例来源:origin: xalan/xalan

if (!XML11Char.isXML11ValidQName(name)) {
  ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
  parser.reportError(Constants.ERROR, err);

代码示例来源:origin: robovm/robovm

if ((nodeName != null) && (!m_name_avt.isSimple()) && (!XML11Char.isXML11ValidQName(nodeName)))

代码示例来源:origin: xalan/xalan

if (!XML11Char.isXML11ValidQName(name)) {
  ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
  parser.reportError(Constants.ERROR, err);

代码示例来源:origin: xalan/xalan

if (!XML11Char.isXML11ValidQName(name)) {
  reportError(this, parser, ErrorMsg.ILLEGAL_ATTR_NAME_ERR, name);
  return;

代码示例来源:origin: xalan/xalan

if ((nodeName != null) && (!m_name_avt.isSimple()) && (!XML11Char.isXML11ValidQName(nodeName)))

代码示例来源:origin: xalan/xalan

if (!XML11Char.isXML11ValidQName(name)){
  ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
  parser.reportError(Constants.ERROR, err);

代码示例来源:origin: xalan/xalan

if (!XML11Char.isXML11ValidQName(name)) {
ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
        name, this);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xalan

/**
 * Utility function to check if a name is a valid qname
 * This method should only be invoked if the attribute value is an AVT
 */    
public static void checkQName(String name) {
  if (!XML11Char.isXML11ValidQName(name)) {
    runTimeError(INVALID_QNAME_ERR,name); 
  }  
}

代码示例来源:origin: org.apache.xalan/com.springsource.org.apache.xalan

/**
 * Utility function to check if a name is a valid qname
 * This method should only be invoked if the attribute value is an AVT
 */    
public static void checkQName(String name) {
  if (!XML11Char.isXML11ValidQName(name)) {
    runTimeError(INVALID_QNAME_ERR,name); 
  }  
}

代码示例来源:origin: org.apache.karaf.bundles/org.apache.karaf.bundles.xalan-2.7.1

/**
 * Utility function to check if a name is a valid qname
 * This method should only be invoked if the attribute value is an AVT
 */    
public static void checkQName(String name) {
  if (!XML11Char.isXML11ValidQName(name)) {
    runTimeError(INVALID_QNAME_ERR,name); 
  }  
}

相关文章