## org.apache.xerces.util
Class XML11Char

    java.lang.Object
      |
      +--org.apache.xerces.util.XML11Char

public class XML11Char
extends java.lang.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.

Version:
  $Id: XML11Char.java,v 1.1 2002/12/07 00:24:06 neilg Exp $
Author:
  Glenn Marcy, IBM, Andy Clark, IBM, Arnaud Le Hors, IBM, Neil Graham, IBM

Field Summary
`static int` `MASK_XML11_CONTENT` XML 1.1 content (valid - "special" chars)
`static int` `MASK_XML11_CONTROL` XML 1.1 control character mask
`static int` `MASK_XML11_NAME` XML 1.1 Name character mask.
`static int` `MASK_XML11_NAME_START` XML 1.1 Name start character mask.
`static int` `MASK_XML11_NCNAME` XML namespaces 1.1 NCName
`static int` `MASK_XML11_NCNAME_START` XML namespaces 1.1 NCNameStart
`static int` `MASK_XML11_SPACE` XML 1.1 Space character mask.
`static int` `MASK_XML11_VALID` XML 1.1 Valid character mask.
`static byte[]` `XML11CHARS` Character flags for XML 1.1.

Constructor Summary
`XML11Char()`

Method Summary
`static boolean` `isXML11Content(int c)` Returns true if the specified character can be considered content.
`static boolean` `isXML11Invalid(int c)` Returns true if the specified character is invalid.
`static boolean` `isXML11Name(int c)` Returns true if the specified character is a valid name character as defined by production [4a] in the XML 1.1 specification.
`static boolean` `isXML11NameStart(int c)` Returns true if the specified character is a valid name start character as defined by production [4] in the XML 1.1 specification.
`static boolean` `isXML11NCName(int c)` Returns true if the specified character is a valid NCName character as defined by production [5] in Namespaces in XML 1.1 recommendation.
`static boolean` `isXML11NCNameStart(int c)` Returns true if the specified character is a valid NCName start character as defined by production [4] in Namespaces in XML 1.1 recommendation.
`static boolean` `isXML11Space(int c)` Returns true if the specified character is a space character as amdended in the XML 1.1 specification.
`static boolean` `isXML11Valid(int c)` Returns true if the specified character is valid.
`static boolean` `isXML11ValidLiteral(int c)` Returns true if the specified character is valid and permitted outside of a character reference.
`static boolean` `isXML11ValidName(java.lang.String name)` Check to see if a string is a valid Name according to [5] in the XML 1.1 Recommendation
`static boolean` `isXML11ValidNCName(java.lang.String ncName)` Check to see if a string is a valid NCName according to [4] from the XML Namespaces 1.1 Recommendation
`static boolean` `isXML11ValidNmtoken(java.lang.String nmtoken)` Check to see if a string is a valid Nmtoken according to [7] in the XML 1.1 Recommendation

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### XML11CHARS

    public static final byte[] XML11CHARS

  Character flags for XML 1.1.

### MASK_XML11_VALID

    public static final int MASK_XML11_VALID

  XML 1.1 Valid character mask.

### MASK_XML11_SPACE

    public static final int MASK_XML11_SPACE

  XML 1.1 Space character mask.

### MASK_XML11_NAME_START

    public static final int MASK_XML11_NAME_START

  XML 1.1 Name start character mask.

### MASK_XML11_NAME

    public static final int MASK_XML11_NAME

  XML 1.1 Name character mask.

### MASK_XML11_CONTROL

    public static final int MASK_XML11_CONTROL

  XML 1.1 control character mask

### MASK_XML11_CONTENT

    public static final int MASK_XML11_CONTENT

  XML 1.1 content (valid - "special" chars)

### MASK_XML11_NCNAME_START

    public static final int MASK_XML11_NCNAME_START

  XML namespaces 1.1 NCNameStart

### MASK_XML11_NCNAME

    public static final int MASK_XML11_NCNAME

  XML namespaces 1.1 NCName

Constructor Detail

### XML11Char

    public XML11Char()

Method Detail

### isXML11Space

    public static boolean isXML11Space(int c)

  Returns true if the specified character is a space character as amdended in the XML 1.1 specification.
  Parameters:
    `c` - The character to check.

### isXML11Valid

    public static boolean isXML11Valid(int c)

  Returns true if the specified character is valid. This method also checks the surrogate character range from 0x10000 to 0x10FFFF.

  If the program chooses to apply the mask directly to the `XML11CHARS` array, then they are responsible for checking the surrogate character range.

  Parameters:
    `c` - The character to check.

### isXML11Invalid

    public static boolean isXML11Invalid(int c)

  Returns true if the specified character is invalid.
  Parameters:
    `c` - The character to check.

### isXML11ValidLiteral

    public static boolean isXML11ValidLiteral(int c)

  Returns true if the specified character is valid and permitted outside of a character reference. That is, this method will return false for the same set as isXML11Valid, except it also reports false for "control characters".
  Parameters:
    `c` - The character to check.

### isXML11Content

    public static boolean isXML11Content(int c)

  Returns true if the specified character can be considered content.
  Parameters:
    `c` - The character to check.

### isXML11NameStart

    public static boolean isXML11NameStart(int c)

  Returns true if the specified character is a valid name start character as defined by production [4] in the XML 1.1 specification.
  Parameters:
    `c` - The character to check.

### isXML11Name

    public static boolean isXML11Name(int c)

  Returns true if the specified character is a valid name character as defined by production [4a] in the XML 1.1 specification.
  Parameters:
    `c` - The character to check.

### isXML11NCNameStart

    public static boolean isXML11NCNameStart(int c)

  Returns true if the specified character is a valid NCName start character as defined by production [4] in Namespaces in XML 1.1 recommendation.
  Parameters:
    `c` - The character to check.

### isXML11NCName

    public static boolean isXML11NCName(int c)

  Returns true if the specified character is a valid NCName character as defined by production [5] in Namespaces in XML 1.1 recommendation.
  Parameters:
    `c` - The character to check.

### isXML11ValidName

    public static boolean isXML11ValidName(java.lang.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(java.lang.String ncName)

  Check to see if a string is a valid NCName according to [4] from the XML Namespaces 1.1 Recommendation
  Parameters:
    `name` - string to check
  Returns:
    true if name is a valid NCName

### isXML11ValidNmtoken

    public static boolean isXML11ValidNmtoken(java.lang.String nmtoken)

  Check to see if a string is a valid Nmtoken according to [7] in the XML 1.1 Recommendation
  Parameters:
    `nmtoken` - string to check
  Returns:
    true if nmtoken is a valid Nmtoken

Copyright © 1999-2003 Apache XML Project. All Rights Reserved.