org.apache.batik.xml.XMLUtilities.testXMLQName()方法的使用及代码示例

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

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

XMLUtilities.testXMLQName介绍

[英]Test whether the given string is an XML 1.0 Name and/or QName.
[中]测试给定字符串是否为XML 1.0名称和/或QName。

代码示例

代码示例来源:origin: org.apache.xmlgraphics/batik-dom

/**
   * <b>DOM</b>: Implements {@link
   * DOMImplementation#createDocumentType(String,String,String)}.
   */
  public DocumentType createDocumentType(String qualifiedName,
                      String publicId,
                      String systemId) {

    if (qualifiedName == null) {
      qualifiedName = "";
    }
    int test = XMLUtilities.testXMLQName(qualifiedName);
    if ((test & XMLUtilities.IS_XML_10_NAME) == 0) {
      throw new DOMException
        (DOMException.INVALID_CHARACTER_ERR,
         formatMessage("xml.name",
                new Object[] { qualifiedName }));
    }
    if ((test & XMLUtilities.IS_XML_10_QNAME) == 0) {
      throw new DOMException
        (DOMException.INVALID_CHARACTER_ERR,
         formatMessage("invalid.qname",
                new Object[] { qualifiedName }));
    }
    return new GenericDocumentType(qualifiedName, publicId, systemId);
  }
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
   * <b>DOM</b>: Implements {@link
   * DOMImplementation#createDocumentType(String,String,String)}.
   */
  public DocumentType createDocumentType(String qualifiedName,
                      String publicId,
                      String systemId) {

    if (qualifiedName == null) {
      qualifiedName = "";
    }
    int test = XMLUtilities.testXMLQName(qualifiedName);
    if ((test & XMLUtilities.IS_XML_10_NAME) == 0) {
      throw new DOMException
        (DOMException.INVALID_CHARACTER_ERR,
         formatMessage("xml.name",
                new Object[] { qualifiedName }));
    }
    if ((test & XMLUtilities.IS_XML_10_QNAME) == 0) {
      throw new DOMException
        (DOMException.INVALID_CHARACTER_ERR,
         formatMessage("invalid.qname",
                new Object[] { qualifiedName }));
    }
    return new GenericDocumentType(qualifiedName, publicId, systemId);
  }
}

代码示例来源:origin: org.apache.xmlgraphics/batik-dom

/**
 * <b>DOM</b>: Implements DOMImplementation#createDocumentType(String,String,String).
 */
public DocumentType createDocumentType(String qualifiedName,
                    String publicId,
                    String systemId) {
  if (qualifiedName == null) {
    qualifiedName = "";
  }
  int test = XMLUtilities.testXMLQName(qualifiedName);
  if ((test & XMLUtilities.IS_XML_10_NAME) == 0) {
    throw new DOMException
      (DOMException.INVALID_CHARACTER_ERR,
       formatMessage("xml.name",
              new Object[] { qualifiedName }));
  }
  if ((test & XMLUtilities.IS_XML_10_QNAME) == 0) {
    throw new DOMException
      (DOMException.INVALID_CHARACTER_ERR,
       formatMessage("invalid.qname",
              new Object[] { qualifiedName }));
  }
  return new GenericDocumentType(qualifiedName, publicId, systemId);
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * <b>DOM</b>: Implements {@link
 * DOMImplementation#createDocumentType(String,String,String)}.
 */
public DocumentType createDocumentType(String qualifiedName,
                    String publicId,
                    String systemId) {
  if (qualifiedName == null) {
    qualifiedName = "";
  }
  int test = XMLUtilities.testXMLQName(qualifiedName);
  if ((test & XMLUtilities.IS_XML_10_NAME) == 0) {
    throw new DOMException
      (DOMException.INVALID_CHARACTER_ERR,
       formatMessage("xml.name",
              new Object[] { qualifiedName }));
  }
  if ((test & XMLUtilities.IS_XML_10_QNAME) == 0) {
    throw new DOMException
      (DOMException.INVALID_CHARACTER_ERR,
       formatMessage("invalid.qname",
              new Object[] { qualifiedName }));
  }
  return new GenericDocumentType(qualifiedName, publicId, systemId);
}

代码示例来源:origin: apache/batik

/**
   * <b>DOM</b>: Implements {@link
   * DOMImplementation#createDocumentType(String,String,String)}.
   */
  public DocumentType createDocumentType(String qualifiedName,
                      String publicId,
                      String systemId) {

    if (qualifiedName == null) {
      qualifiedName = "";
    }
    int test = XMLUtilities.testXMLQName(qualifiedName);
    if ((test & XMLUtilities.IS_XML_10_NAME) == 0) {
      throw new DOMException
        (DOMException.INVALID_CHARACTER_ERR,
         formatMessage("xml.name",
                new Object[] { qualifiedName }));
    }
    if ((test & XMLUtilities.IS_XML_10_QNAME) == 0) {
      throw new DOMException
        (DOMException.INVALID_CHARACTER_ERR,
         formatMessage("invalid.qname",
                new Object[] { qualifiedName }));
    }
    return new GenericDocumentType(qualifiedName, publicId, systemId);
  }
}

代码示例来源:origin: apache/batik

/**
 * <b>DOM</b>: Implements DOMImplementation#createDocumentType(String,String,String).
 */
public DocumentType createDocumentType(String qualifiedName,
                    String publicId,
                    String systemId) {
  if (qualifiedName == null) {
    qualifiedName = "";
  }
  int test = XMLUtilities.testXMLQName(qualifiedName);
  if ((test & XMLUtilities.IS_XML_10_NAME) == 0) {
    throw new DOMException
      (DOMException.INVALID_CHARACTER_ERR,
       formatMessage("xml.name",
              new Object[] { qualifiedName }));
  }
  if ((test & XMLUtilities.IS_XML_10_QNAME) == 0) {
    throw new DOMException
      (DOMException.INVALID_CHARACTER_ERR,
       formatMessage("invalid.qname",
              new Object[] { qualifiedName }));
  }
  return new GenericDocumentType(qualifiedName, publicId, systemId);
}

相关文章