anchor.diff:     Marker = lists:reverse(TmpAcc),
      M = parse_datetime_marker(Marker),
      parse_datetime_pattern1(Pattern, {literal, []}, [{marker,M}|Acc]);
  -parse_datetime_pattern1([H|Pattern], {marker, TmpAcc}, Acc) when H == 9;
  -                                                                 H == 10;
  -                                                                 H == 13;
  -                                                                 H == 32 ->
  +parse_datetime_pattern1([H|Pattern], {marker, TmpAcc}, Acc) when H =:= 9;
  +                                                                 H =:= 10;
  +                                                                 H =:= 13;
  +                                                                 H =:= 32 ->
      parse_datetime_pattern1(Pattern, {marker, TmpAcc}, Acc);
   parse_datetime_pattern1([H|Pattern], {marker, TmpAcc}, Acc) ->
      parse_datetime_pattern1(Pattern, {marker, [H|TmpAcc]}, Acc).
   
  -parse_datetime_marker([$Y|Rest]) -> {year,      parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$M|Rest]) -> {month,     parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$D|Rest]) -> {day,       parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$d|Rest]) -> {doy,       parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$F|Rest]) -> {dow,       parse_datetime_modifiers(Rest,"n")};
  -parse_datetime_marker([$W|Rest]) -> {woy,       parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$w|Rest]) -> {wom,       parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$H|Rest]) -> {hour24,    parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$h|Rest]) -> {hour12,    parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$P|Rest]) -> {ampm,      parse_datetime_modifiers(Rest,"n")};
  -parse_datetime_marker([$m|Rest]) -> {minute,    parse_datetime_modifiers(Rest,"01")};
  -parse_datetime_marker([$s|Rest]) -> {secint,    parse_datetime_modifiers(Rest,"01")};
  -parse_datetime_marker([$f|Rest]) -> {secfract,  parse_datetime_modifiers(Rest,"1")};
  -parse_datetime_marker([$Z|Rest]) -> {tz,        parse_datetime_modifiers(Rest,"01:01")};
  -parse_datetime_marker([$z|Rest]) -> {tzpre,     parse_datetime_modifiers(Rest,"01:01")};
  -parse_datetime_marker([$C|Rest]) -> {calendar,  parse_datetime_modifiers(Rest,"n")};
  -parse_datetime_marker([$E|Rest]) -> {era,       parse_datetime_modifiers(Rest,"n")};
  +parse_datetime_marker([$Y|Rest]) -> 
  +   {year,      parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$M|Rest]) -> 
  +   {month,     parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$D|Rest]) -> 
  +   {day,       parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$d|Rest]) -> 
  +   {doy,       parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$F|Rest]) -> 
  +   {dow,       parse_datetime_modifiers(Rest,"n")};
  +parse_datetime_marker([$W|Rest]) -> 
  +   {woy,       parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$w|Rest]) -> 
  +   {wom,       parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$H|Rest]) -> 
  +   {hour24,    parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$h|Rest]) -> 
  +   {hour12,    parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$P|Rest]) -> 
  +   {ampm,      parse_datetime_modifiers(Rest,"n")};
  +parse_datetime_marker([$m|Rest]) -> 
  +   {minute,    parse_datetime_modifiers(Rest,"01")};
  +parse_datetime_marker([$s|Rest]) -> 
  +   {secint,    parse_datetime_modifiers(Rest,"01")};
  +parse_datetime_marker([$f|Rest]) -> 
  +   {secfract,  parse_datetime_modifiers(Rest,"1")};
  +parse_datetime_marker([$Z|Rest]) -> 
  +   {tz,        parse_datetime_modifiers(Rest,"01:01")};
  +parse_datetime_marker([$z|Rest]) -> 
  +   {tzpre,     parse_datetime_modifiers(Rest,"01:01")};
  +parse_datetime_marker([$C|Rest]) -> 
  +   {calendar,  parse_datetime_modifiers(Rest,"n")};
  +parse_datetime_marker([$E|Rest]) -> 
  +   {era,       parse_datetime_modifiers(Rest,"n")};
   parse_datetime_marker(_) ->
  -   xqerl_error:error('FOFD1340').
  +   ?err('FOFD1340').
   
   parse_datetime_modifiers(Mods,Default) ->
      case string:split(Mods,[$,],trailing) of
  
positive.code:                               ToChange = MinLen - ManLen,
                                OptToChange = min(OptLen, ToChange),
                                ManToAdd = ToChange - OptToChange,
                                {_,C} = lists:keyfind(digit, 1, Format), % character to use
                                F1 = optional_to_mandatory(Format,OptToChange,C),
                                F1 ++ lists:duplicate(ManToAdd, {digit, C});
                             true ->
  
negative.code:                               end,
     PatternType = pattern_type(PrimaryToken),
     ModifierType = modifier_type(Modifier),
     if PatternType =:= decimal_digit_pattern, ModifierType =:= cardinal ->
           Str = integer_to_list(Int1),
           Format = parse_decimal_digit_pattern(PrimaryToken),
           Sign ++ format_decimal(Str, Format);
        PatternType =:= decimal_digit_pattern ->
           Format = parse_decimal_digit_pattern(PrimaryToken),
           Sign ++ format_integer(Int1, Format, ModifierType);
        PatternType =:= roman_upper ->
           Sign ++int_to_upper_roman(Int1);
        PatternType =:= roman_lower ->
           Sign ++ int_to_lower_roman(Int1);
        PatternType =:= alpha_lower ->
           Sign ++ int_to_alpha(Int1, lower);
        PatternType =:= alpha_upper ->
           Sign ++ int_to_alpha(Int1, upper);
        PatternType =:= words_lower, ModifierType =:= cardinal;
        PatternType =:= words_lower, ModifierType =:= alpha  ->
           Sign ++ string:lowercase(num_to_text(Int1, en));
        PatternType =:= words_lower ->
           Sign ++ string:lowercase(num_to_text(Int1, en, ModifierType));
        PatternType =:= words_upper, ModifierType =:= cardinal;
        PatternType =:= words_upper, ModifierType =:= alpha  ->
           Sign ++ string:uppercase(num_to_text(Int1, en));
        PatternType =:= words_upper ->
           Sign ++ string:uppercase(num_to_text(Int1, en, ModifierType));
        PatternType =:= words_title, ModifierType =:= cardinal;
        PatternType =:= words_title, ModifierType =:= alpha -> 
           % as-is is titlecase
           Sign ++ num_to_text(Int1, en);
        PatternType == words_title -> % as-is is titlecase
           Sign ++ num_to_text(Int1, en, ModifierType);
        PatternType =:= one, ModifierType =:= cardinal ->
           Str = integer_to_list(Int1),
           Format = case is_nondecimal_digit(PrimaryToken) of
                       true ->
  