Class XMLCharacterData

java.lang.Object
net.sf.saxon.serialize.charcode.XMLCharacterData

public class XMLCharacterData extends Object
This module contains data regarding the classification of characters in XML 1.0 and XML 1.1, and a number of interrogative methods to support queries on this data.

For characters in the BMP, the information is tabulated by means of an array of one-byte entries, one for each character, with bit-significant property settings. For characters outside the BMP, the rules are built in to the interrogative methods.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximum code point for a character permitted in an XML 1.1 name
    static final byte
    Bit setting to indicate that a character is valid in an XML 1.0 name
    static final byte
    Bit setting to indicate that a character is valid in an XML 1.1 name
    static final byte
    Bit setting to indicate that a character is valid at the start of an XML 1.0 name
    static final byte
    Bit setting to indicate that a character is valid at the start of an XML 1.1 name
    static final byte
    Bit setting to indicate that a character is valid in XML 1.0
    static final byte
    Bit setting to indicate that a character is valid in XML 1.1
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getCategory(byte mask)
    Get all the characters in a given category, as an integer set.
    static boolean
    isNCName10(int i)
    Determine whether a character is valid in an NCName in XML 1.0
    static boolean
    isNCName11(int i)
    Determine whether a character is valid in an NCName in XML 1.1
    static boolean
    Determine whether a character is valid at the start of an NCName in XML 1.0
    static boolean
    Determine whether a character is valid at the start of an NCName in XML 1.1
    static boolean
    isValid10(int i)
    Determine whether a character is valid in XML 1.0
    static boolean
    isValid11(int i)
    Determine whether a character is valid in XML 1.1

    Methods inherited from class java.lang.Object

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

    • VALID_10_MASK

      public static final byte VALID_10_MASK
      Bit setting to indicate that a character is valid in XML 1.0
      See Also:
    • NAME_10_MASK

      public static final byte NAME_10_MASK
      Bit setting to indicate that a character is valid in an XML 1.0 name
      See Also:
    • NAME_START_10_MASK

      public static final byte NAME_START_10_MASK
      Bit setting to indicate that a character is valid at the start of an XML 1.0 name
      See Also:
    • VALID_11_MASK

      public static final byte VALID_11_MASK
      Bit setting to indicate that a character is valid in XML 1.1
      See Also:
    • NAME_11_MASK

      public static final byte NAME_11_MASK
      Bit setting to indicate that a character is valid in an XML 1.1 name
      See Also:
    • NAME_START_11_MASK

      public static final byte NAME_START_11_MASK
      Bit setting to indicate that a character is valid at the start of an XML 1.1 name
      See Also:
    • MAX_XML11_NAME_CHAR

      public static final int MAX_XML11_NAME_CHAR
      Maximum code point for a character permitted in an XML 1.1 name
      See Also:
  • Constructor Details

    • XMLCharacterData

      public XMLCharacterData()
  • Method Details

    • isValid10

      public static boolean isValid10(int i)
      Determine whether a character is valid in XML 1.0
      Parameters:
      i - the character
      Returns:
      true if the character is valid in XML 1.0
    • isNCName10

      public static boolean isNCName10(int i)
      Determine whether a character is valid in an NCName in XML 1.0
      Parameters:
      i - the character
      Returns:
      true if the character is valid in an NCName in XML 1.0
    • isNCNameStart10

      public static boolean isNCNameStart10(int i)
      Determine whether a character is valid at the start of an NCName in XML 1.0
      Parameters:
      i - the character
      Returns:
      true if the character is valid at the start of an NCName in XML 1.0
    • isValid11

      public static boolean isValid11(int i)
      Determine whether a character is valid in XML 1.1
      Parameters:
      i - the character
      Returns:
      true if the character is valid in XML 1.1
    • isNCName11

      public static boolean isNCName11(int i)
      Determine whether a character is valid in an NCName in XML 1.1
      Parameters:
      i - the character
      Returns:
      true if the character is valid in an NCName in XML 1.1
    • isNCNameStart11

      public static boolean isNCNameStart11(int i)
      Determine whether a character is valid at the start of an NCName in XML 1.1
      Parameters:
      i - the character
      Returns:
      true if the character is valid at the start of an NCName in XML 1.1
    • getCategory

      public static IntRangeSet getCategory(byte mask)
      Get all the characters in a given category, as an integer set. This must be one of the four name classes: Name characters or Name Start characters in XML 1.0 or XML 1.1. (This method is used to populate the data tables used by the regular expression translators)
      Parameters:
      mask - identifies the properties of the required category
      Returns:
      the set of characters in the given category.