/***************************************************************************
 *  BabbleMUD, copyright (C) 2003 by Nick Gammon and David Haley           *
 *                                                                         *
 *  Email:  Nick Gammon <nick@gammon.com.au>                               *
 *  Web:    http://www.gammon.com.au                                       *
 *  Mail:   PO Box 124, Ivanhoe VIC 3079, Australia                        *
 *                                                                         *
 *  In order to use any part of this server code you must comply with      *
 *  the licence in 'licence.txt'. In particular, you may not remove this   *
 *  copyright notice.                                                      *
 *                                                                         *
 **************************************************************************/

// Error messages used during XML parsing - customise to other languages if you wish

// WARNING - if customising you should keep the replacement characters
//  (eg. %1, %i) in the same order, and present, otherwise the messages will not
//  be produced correctly (they are used inside a printf, in effect).

// bad numbers
#define XML_ERROR_INVALID_HEX_NUMBER    "Invalid hex number in XML entity: &%1;"
#define XML_ERROR_INVALID_NUMBER        "Invalid number in XML entity: &%1;"
#define XML_ERROR_DISALLOWED_NUMBER     "Disallowed number in XML entity: &%1;"
#define XML_ERROR_UNKNOWN_ENTITY        "Unknown XML entity: &%1;"
#define XML_ERROR_INVALID_ATTRIBUTE_NUMBER  "Invalid number \"%1\" in attribute: %2"
#define XML_ERROR_NUMBER_TOO_SMALL  \
    "Value '%1' too small in numeric attribute named '%2'. Range is %3 to %4."
#define XML_ERROR_NUMBER_TOO_LARGE  \
    "Value '%1' too large in numeric attribute named '%2'. Range is %3 to %4."
#define XML_ERROR_BAD_BOOLEAN \
    "Boolean attribute named \"%1\" has unrecognised value \"%2\""
#define XML_ERROR_BAD_COLOUR "Invalid colour name: \"%1\""
#define XML_ERROR_COLOUR_NOT_FOUND "Colour name \"%1\" unknown"


// bad comments
#define XML_ERROR_UNTERMINATED_COMMENT  "Unterminated comment at end of file"
#define XML_ERROR_COMMENT_NOT_VALID     "Comment not valid here"
#define XML_ERROR_INVALID_COMMENT       "Invalid '--' inside comment"

// file problems
#define XML_ERROR_ZERO_LENGTH_FILE      "Zero length XML file"
#define XML_ERROR_UNEXPECTED_EOF_1      "Unexpected end-of-file looking for %1 name"
#define XML_ERROR_UNEXPECTED_EOF_2      "Unexpected end-of-file looking for value of %1 named %2"
#define XML_ERROR_UNEXPECTED_EOF_3      "Unexpected end-of-file while looking for </%1>"
#define XML_ERROR_UNEXPECTED_EOF_4      "Unexpected end-of-file inside [CDATA[ definition"
#define XML_ERROR_UNEXPECTED_EOF_5      "Unexpected end-of-file after '</%1'"
#define XML_ERROR_UNEXPECTED_EOF_6      "Unexpected end-of-file inside element definition for %1"
#define XML_ERROR_UNEXPECTED_EOF_7      "Unexpected end-of-file inside <!DOCTYPE> declaration"
#define XML_ERROR_UNEXPECTED_EOF_8      "Unexpected end-of-file inside DTD declaration"

// out of memory
#define XML_ERROR_OUT_OF_MEMORY_1       "Could not allocate memory for XML parsing of element %1"
#define XML_ERROR_OUT_OF_MEMORY_2       "Could not allocate memory for XML parsing of attribute %1"
#define XML_ERROR_OUT_OF_MEMORY_3       "Could not allocate memory for XML DTD parsing of item %1"

// CDATA problems
#define XML_ERROR_NO_CDATA_1              "<![CDATA[ invalid at root level"
#define XML_ERROR_NO_CDATA_2              "Unexpected '<![CDATA[' inside element definition"
#define XML_ERROR_NO_CDATA_TERMINATOR_1   "Value for %1 named '%2' may not contain CDATA terminator: ']]>'"
#define XML_ERROR_NO_CDATA_TERMINATOR_2   "CDATA terminator ']]>' invalid"

// unprintable characters
#define XML_ERROR_NON_PRINTABLE_VALUE_1  "Non-printable character, code %1, not permitted for value for %2 named '%3'"
#define XML_ERROR_NON_PRINTABLE_VALUE_2  "Non-printable character, code %1, not permitted"

// bad names
#define XML_ERROR_BAD_NAME        "%1 name must start with letter or underscore, but starts with \"%2\""
#define XML_ERROR_NAME_TOO_LONG   "%1 name is too long (%2 characters) - maximum permitted is %3 characters"

// bad values
#define XML_ERROR_NO_VALUE              "Value for %1 named '%2' not supplied (in quotes)"
#define XML_ERROR_VALUE_NOT_TERMINATED  "Value for %1 named '%2' not terminated (no closing quote)"

// syntax and semantics
#define XML_ERROR_NO_ROOT_CONTENT           "Expected '<', got \"%1\" (content not permitted here)"
#define XML_ERROR_SURPLUS_CHARACTERS        "Surplus characters after '</%1'"
#define XML_ERROR_UNEXPECTED_CLOSE_TAG      "Unexpected closing tag </%1> - no corresponding opening tag"
#define XML_ERROR_BAD_TERMINATION_SEQUENCE  "Elements terminated out of sequence, expected </%1>, got </%2>"
#define XML_ERROR_DUPLICATE_ATTRIBUTE       "Duplicate attribute name '%1'"
#define XML_ERROR_NO_EQUALS                 "Attribute name '%1' not followed by '='"
#define XML_ERROR_BAD_DECLARATION           "Unrecognised declaration: <!%1 ...>"

// not implemented
#define XML_ERROR_NOT_IMPLEMENTED_1         "Unsupported declaration \"%1\" inside <!DOCTYPE ...>"
#define XML_ERROR_NOT_IMPLEMENTED_2         "Unsupported declaration inside <!DOCTYPE ...>"
#define XML_ERROR_NOT_IMPLEMENTED_3         "Unsupported declaration <!%1 ...>"

// DTD declaration problems
#define XML_ERROR_BAD_DTD_DECLARATION     "Expected '<!', got %1"
#define XML_ERROR_NAME_RESERVED           "Names starting with \"XML\" are reserved"
#define XML_ERROR_EXPECTED_GREATER_SIGN   "Expected '>', got %1"
#define XML_ERROR_NO_CLOSING_SEMICOLON    "No closing \";\" in XML entity argument \"&%1\""

// write errors

#define XML_ERROR_CANNOT_WRITE_FILE     "Could not write XML file: %1"
#define XML_ERROR_CHILDREN_IN_EMPTY_ELEMENT "Have children for element 'empty' element <%1>"
#define XML_ERROR_CONTENTS_IN_EMPTY_ELEMENT "Have contents for element 'empty' element <%1>"

// read errors

#define XML_ERROR_CANNOT_OPEN_FILE      "Could not open file: %1"
#define XML_ERROR_CANNOT_FIND_FILE_SIZE "Cannot seek to end of file of: %1"
#define XML_ERROR_FILE_TOO_LARGE        "XML file \"%1\"too large - maximum permitted is %2 bytes"
#define XML_ERROR_CANNOT_READ_FILE      "Could not read XML file: %1"

// general error message

#define XML_ERROR_GENERAL_MESSAGE        "[ %1 ]\n%2^\n%4\n(Error occurs on line %3)"
#define XML_ERROR_BAD_ATTRIBUTE_VALUE    "%1\nError occurs in <%2> (which starts at byte %3)"

// DTD errors (parsing DTD)

#define XML_ERROR_DTD_NAME_NOT_SPECIFIED  "%1 must be specified"
#define XML_ERROR_DTD_INVALID_NAME        "Invalid %1: \"%2\""
#define XML_ERROR_DTD_NO_CHILD_NODE       "Child node %1 does not exist for node %2"
#define XML_ERROR_DTD_ATTRIBUTE_NOT_USED  "Attribute not used: %1"
#define XML_ERROR_DTD_BAD_OPTION          "List option should be 'option', is \"%1\""
#define XML_ERROR_DTD_DUPLICATE_OPTION    "Duplicate option name: \"%1\""
#define XML_ERROR_DTD_DUPLICATE_ATTRIBUTE "Duplicate attribute %1"
#define XML_ERROR_DTD_TYPE_NOT_SPECIFIED  "Attribute type must be specified"
#define XML_ERROR_DTD_INVALID_TYPE        "Invalid attribute type: %1"
#define XML_ERROR_DTD_NO_LIST_ITEMS       "No valid entries specified for list type: %1"
#define XML_ERROR_DTD_DUPLICATE_CHILD     "Duplicate child %1"
#define XML_ERROR_DTD_UNKNOWN_DECLARATION "Unknown DTD declaration: \"%1\""
#define XML_ERROR_DTD_BAD_NODE            "DTD node should be 'node', is \"%1\""
#define XML_ERROR_DTD_DUPLICATE_DTD       "Duplicate DTD for %1"
#define XML_ERROR_DTD_BAD_ROOT            "DTD root document should be 'dtd', is \"%1\""
#define XML_ERROR_DTD_NAME_RESERVED       "Reserved word invalid for %1: \"%2\""

