Class XMLUtil

java.lang.Object
io.permazen.util.XMLUtil

public final class XMLUtil extends Object
XML related utility methods.
  • Method Details

    • isValidChar

      public static boolean isValidChar(int codepoint)
      Determine if the given character may appear in an XML document.
      Parameters:
      codepoint - character codepoint
      Returns:
      true if codepoint is a valid XML character
      See Also:
    • isValidName

      public static boolean isValidName(String name)
      Determine if the given string is a valid XML name.
      Parameters:
      name - name
      Returns:
      true if name is a valid XML name
      Throws:
      IllegalArgumentException - if name is null
      See Also:
    • isValidNameStart

      public static boolean isValidNameStart(int codepoint)
      Determine if a character may appear in an XML name as the first character.

      If so, the character may appear anywhere in an XML element or attribute name.

      Parameters:
      codepoint - character
      Returns:
      true if ch is valid at the beginning of an XML name
      See Also:
    • isValidNamePart

      public static boolean isValidNamePart(int codepoint)
      Determine if a character may appear in an XML name.

      If so, the character may appear in an XML element or attribute name, though not necessarily as the first character.

      Parameters:
      codepoint - character
      Returns:
      true if ch is valid in an XML name
      See Also: