1
/* xml_error.c - Error reporting for XML parsing/validation.
2
Copyright (c) 2008, Robert D. Cameron and Dan Lin.
3
Licensed to the public under the Open Software License 3.0.
4
Licensed to International Characters, Inc., under the Academic
10
void ShowConstraintError(XML_Constraint errCode) {
11
if (errCode < vErr_vc_roottype) {
12
fprintf(stderr, "Violation of well-formedness constraint: %s\n", XML_Constraint_Strings[errCode]);
16
fprintf(stderr, "Violation of validity constraint: %s\n", XML_Constraint_Strings[errCode]);
21
void ShowSyntaxError(XML_NonTerminal errCode) {
22
fprintf(stderr, "Syntax error in production: %s\n", XML_NonTerminal_Names[errCode]);
26
void NoEncodingError(char * msg) {
27
fprintf(stderr, "Error : %s\n", msg);
31
void EncodingError(char * msg, unsigned char * encoding, int lgth) {
32
fprintf(stderr, "Error : Illegal/unsupported %s encoding of length %i: \"", msg, lgth);
33
for (int i = 0; i < lgth; i++) fprintf(stderr, "%c", encoding[i]);
34
fprintf(stderr, "\"\n");
38
void CharSetValidationError(char * encoding, int err_pos) {
39
fprintf(stderr, "Error: Invalid %s character in input stream at position %i\n", encoding, err_pos);
43
void XMLCharacterError(int err_pos) {
44
fprintf(stderr, "Illegal control character in XML input stream at position %i\n", err_pos);
48
void IncompleteCodeUnitError() {
49
fprintf(stderr, "Error: Incomplete code unit at end of file.\n");
53
void DeclarationError(int pos) {
54
fprintf(stderr, "Parsing error at position %i in XML or Text declaration.\n", pos);
58
void ImplementationLimitError(char * msg) {
59
fprintf(stderr, "Fatal implementation limit - %s\n", msg);
63
void ContentModelError() {
64
fprintf(stderr, "Error: nondeterminism in content model.\n");