java.lang.Object
org.htmlunit.cyberneko.xerces.util.XML11Char

public final class XML11Char extends Object
This class defines the basic properties of characters in XML 1.1. The data in this class can be used to verify that a character is a valid XML 1.1 character or if the character is a space, name start, or name character.

A series of convenience methods are supplied to ease the burden of the developer. Using the character as an index into the XML11CHARS array and applying the appropriate mask flag (e.g. MASK_VALID), yields the same results as calling the convenience methods. There is one exception: check the comments for the isValid method for details.

Author:
Glenn Marcy, IBM, Andy Clark, IBM, Arnaud Le Hors, IBM, Neil Graham, IBM, Michael Glavassevich, IBM
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    XML 1.1 Name character mask.
    static final int
    XML 1.1 Name start character mask.
    static final int
    XML namespaces 1.1 NCName.
    static final int
    XML namespaces 1.1 NCNameStart.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isXML11Name(int c)
    Returns whether the specified character is a valid name character as defined by production [4a] in the XML 1.1 specification.
    static boolean
    Returns whether the given character is a valid high surrogate for a name character.
    static boolean
    Returns whether the specified character is a valid name start character as defined by production [4] in the XML 1.1 specification.
    static boolean
    Returns whether the specified character is a valid NCName character as defined by production [5] in the Namespaces in XML 1.1 recommendation.
    static boolean
    Returns whether the specified character is a valid NCName start character as defined by production [4] in the Namespaces in XML 1.1 recommendation.
    static boolean
    Check to see if a string is a valid Name according to [5] in the XML 1.1 Recommendation.
    static boolean
    Check to see if a string is a valid NCName according to [4] from the XML Namespaces 1.1 Recommendation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MASK_XML11_NAME_START

      public static final int MASK_XML11_NAME_START
      XML 1.1 Name start character mask.
      See Also:
    • MASK_XML11_NAME

      public static final int MASK_XML11_NAME
      XML 1.1 Name character mask.
      See Also:
    • MASK_XML11_NCNAME_START

      public static final int MASK_XML11_NCNAME_START
      XML namespaces 1.1 NCNameStart.
      See Also:
    • MASK_XML11_NCNAME

      public static final int MASK_XML11_NCNAME
      XML namespaces 1.1 NCName.
      See Also:
  • Method Details

    • isXML11NameStart

      public static boolean isXML11NameStart(int c)
      Returns whether the specified character is a valid name start character as defined by production [4] in the XML 1.1 specification.
      Parameters:
      c - the character code point to check
      Returns:
      true if the character is a valid XML 1.1 name start character, false otherwise
    • isXML11Name

      public static boolean isXML11Name(int c)
      Returns whether the specified character is a valid name character as defined by production [4a] in the XML 1.1 specification.
      Parameters:
      c - the character code point to check
      Returns:
      true if the character is a valid XML 1.1 name character, false otherwise
    • isXML11NCNameStart

      public static boolean isXML11NCNameStart(int c)
      Returns whether the specified character is a valid NCName start character as defined by production [4] in the Namespaces in XML 1.1 recommendation.
      Parameters:
      c - the character code point to check
      Returns:
      true if the character is a valid XML 1.1 NCName start character, false otherwise
    • isXML11NCName

      public static boolean isXML11NCName(int c)
      Returns whether the specified character is a valid NCName character as defined by production [5] in the Namespaces in XML 1.1 recommendation.
      Parameters:
      c - the character code point to check
      Returns:
      true if the character is a valid XML 1.1 NCName character, false otherwise
    • isXML11NameHighSurrogate

      public static boolean isXML11NameHighSurrogate(int c)
      Returns whether the given character is a valid high surrogate for a name character. This includes all high surrogates for characters [0x10000 - 0xEFFFF] (everything excluding planes 15 and 16).
      Parameters:
      c - the character code point to check
      Returns:
      true if the character is a valid XML 1.1 name high surrogate, false otherwise
    • isXML11ValidName

      public static boolean isXML11ValidName(String name)
      Check to see if a string is a valid Name according to [5] in the XML 1.1 Recommendation.
      Parameters:
      name - string to check
      Returns:
      true if name is a valid Name
    • isXML11ValidNCName

      public static boolean isXML11ValidNCName(String ncName)
      Check to see if a string is a valid NCName according to [4] from the XML Namespaces 1.1 Recommendation.
      Parameters:
      ncName - string to check
      Returns:
      true if name is a valid NCName