BGB Extension 2: A Few Misc Types


I will define the namespace 'http://bgb-sys.sourceforge.net/bgb-ext/types2'.

This will define:
    null, a null value;
    xstring, a string with character extensions;
    absdate, an alternate date encoding (ISO 8601).

null

Will be serialized as a single tag <null/>.

xstring

This will be comprable to a normal string, except that additional characters may be included in the contents (via escapes):
    \b, backspace;
    \f, form feed;
    \n, newline;
    \r, carriage return;
    \\, a literal \;
    \xHH, a misc ASCII character, where HH is the code in hex;
    \uHHHH, a 16 bit Unicode character;
    \UHHHHHHHH, a 32 bit Unicode character.

Strings may not encode binary data (as the exact representation is local to the implementation).
Similarly, it will be considered invalid to have a string with an embedded null character (\x00, \u0000, or \U00000000).
It is not required that a reciever preserve the full range of the strings contents if not possible within the implementation.

absdate

Will be an absolute date relative to a specific timezone, and will follow ISO 8601.

Encodings (T is a literal within these fragments):
YYYY
YYYY-MM
YYYY-MM-DD
YYYY-MM-DDThh:mmTZD
YYYY-MM-DDThh:mm:ssTZD
YYYY-MM-DDThh:mm:ss.s*TZD

Implementations should only generate dates of the form:
YYYY-MM-DDThh:mm:ss.s*TZD

Where:
YYYY = Year
MM = Month
DD = Day of the Month
hh = Hour
mm = Minute
ss = Second
s* = 1 or more digits representing the fractions of a second
TZD = Time Zone Designator (Z or +hh:mm or -hh:mm), where Z will indicate that the timezone is UTC.

Examples

<value xmlns="http://bgb-sys.sourceforge.net/bgb-ext/types2">
    <null/>
</value>

<value xmlns="http://bgb-sys.sourceforge.net/bgb-ext/types2">
    <xstring>Hello, Multi-Line-String\nAnd a Unicode Character (\u0410)\n\\END OF LINE</xstring>
</value>

<value xmlns="http://bgb-sys.sourceforge.net/bgb-ext/types2">
    <absdate>2397-05-23T05:19:00Z</absdate>
</value>
(a date when the vcr runs out of tape, maybe...).