XML_Encoding Struct Reference

#include <xmlparse.h>

List of all members.

Public Attributes

int map [256]
void * data
int(* convert )(void *data, const char *s)
void(* release )(void *data)


Detailed Description

This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown to the parser. The map[b] member gives information about byte sequences whose first byte is b. If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. If map[b] is -1, then the byte sequence is malformed. If map[b] is -n, where n >= 2, then b is the first byte of an n-byte sequence that encodes a single Unicode scalar value. The data member will be passed as the first argument to the convert function. The convert function is used to convert multibyte sequences; s will point to a n-byte sequence where map[(unsigned char)*s] == -n. The convert function must return the Unicode scalar value represented by this byte sequence or -1 if the byte sequence is malformed. The convert function may be null if the encoding is a single-byte encoding, that is if map[b] >= -1 for all bytes b. When the parser is finished with the encoding, then if release is not null, it will call release passing it the data member; once release has been called, the convert function will not be called again.

Expat places certain restrictions on the encodings that are supported using this mechanism.

1. Every ASCII character that can appear in a well-formed XML document, other than the characters

$\^`{}~

must be represented by a single byte, and that byte must be the same byte that represents that character in ASCII.

2. No character may require more than 4 bytes to encode.

3. All characters encoded must have Unicode scalar values <= 0xFFFF, (ie characters that would be encoded by surrogates in UTF-16 are not allowed). Note that this restriction doesn't apply to the built-in support for UTF-8 and UTF-16.

4. No Unicode character may be encoded by more than one distinct sequence of bytes.


Member Data Documentation

int(* XML_Encoding::convert)(void *data, const char *s)
 

void* XML_Encoding::data
 

int XML_Encoding::map[256]
 

void(* XML_Encoding::release)(void *data)
 


The documentation for this struct was generated from the following file:
Generated on Mon May 29 01:10:34 2006 for Papagan by  doxygen 1.4.6-NO