Package io.permazen.util
Class XMLUtil
java.lang.Object
io.permazen.util.XMLUtil
XML related utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isValidChar
(int codepoint) Determine if the given character may appear in an XML document.static boolean
isValidName
(String name) Determine if the given string is a valid XML name.static boolean
isValidNamePart
(int codepoint) Determine if a character may appear in an XML name.static boolean
isValidNameStart
(int codepoint) Determine if a character may appear in an XML name as the first character.
-
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
Determine if the given string is a valid XML name.- Parameters:
name
- name- Returns:
- true if
name
is a valid XML name - Throws:
IllegalArgumentException
- ifname
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:
-