-
Notifications
You must be signed in to change notification settings - Fork 5
XMLMessages
do- edited this page Apr 21, 2026
·
10 revisions
XMLMessages is a static utility class for consistent error reporting across xml-toolkit.
It centralizes:
- error code definitions (human-readable templates),
- message formatting with argument substitution,
- error object creation with debug metadata.
All messages are stored in XMLMessages.VOCABULARY — a Map<code, template>.
| Prefix | Scope | Example codes |
|---|---|---|
XML- |
Core XML parsing |
XML-00001, XML-00002, XML-00003
|
XSD- |
XML Schema definitions |
XSD-00001, XSD-00002
|
XVC- |
Validation: structure/constraints |
XVC-00001 … XVC-00005
|
XVS- |
Validation: simple type values |
XVS-00001 … XVS-00041
|
| Code | Template | When raised |
|---|---|---|
XML-00001 |
maxLength=%i exceeded |
XMLLexer encountered a lexeme longer than maxLength option |
XML-00002 |
Unbalanced end element |
</tag> without matching <tag>
|
XML-00003 |
Unmatched end element, %s expected |
</wrong> when </expected> was anticipated |
| Code | Template | When raised |
|---|---|---|
XSD-00001 |
Unknown namespace: %s |
Referenced namespace not found in loaded schemas |
XSD-00002 |
The element %s is not found in %s |
Element used but not declared in schema |
| Code | Template | When raised |
|---|---|---|
XVC-00001 |
No nested elements allowed inside %s |
Complex type with simpleContent received child elements |
XVC-00002 |
%s is unexpected here; should be %s |
Element order violates xs:sequence/xs:choice
|
XVC-00003 |
Unknown attribute: %s |
Attribute not declared in schema |
XVC-00004 |
The attribute "%s" must have the value "%s", not "%s" |
Fixed-value attribute mismatch |
XVC-00005 |
Missing required attribute: "%s" |
Required attribute absent |
| Code | Template | When raised |
|---|---|---|
XVS-00001 |
The value "%s" doesn't match the pattern %s |
xs:pattern facet mismatch |
XVS-00003 |
The value '%s' is not in list: %s |
xs:enumeration facet mismatch |
XVS-00004–006
|
Length constraint violations |
xs:minLength/maxLength/length
|
XVS-00007–0010
|
Range constraint violations |
xs:minInclusive/maxExclusive etc. |
XVS-00011–00012
|
Boolean parsing errors | Invalid true/false/1/0
|
XVS-00013–00019
|
Decimal parsing errors | Invalid format, digit count, precision |
XVS-00020–00021
|
Float parsing errors | Invalid floating-point syntax |
XVS-00022–00041
|
Date/time parsing errors | Invalid date, time, timezone, separators |