Skip to content

Commit

Permalink
fix error message to include type when casting date to boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
benibela committed Dec 13, 2023
1 parent 4959f7e commit 8889d6a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion data/xquery.pas
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ TXQBoxedValue = class
//procedure FreeInstance;override;

//class function classKind: TXQValueKind; virtual;
function toXQuery: string;
function toXQuery: string; virtual;
function toString: string; override;
end;

Expand Down Expand Up @@ -896,6 +896,7 @@ TXQBoxedQName = class (TXQBoxedValue)
constructor create(const aurl, aprefixedLocal: string);
constructor create(const ns: TNamespace; const alocal: string);
function toString: string; override;
function toXQuery: string; override;
end;


Expand Down Expand Up @@ -923,6 +924,7 @@ TXQBoxedDateTime = class(TXQBoxedValue)

function isDuration: boolean;
function toString: string; override;
function toXQuery: string; override;
function clone: TXQBoxedDateTime;
protected
class function tryCreateFromString(const s, format: string; data: PXQValueDateTimeData): TDateTimeParsingResult; static;
Expand Down
12 changes: 11 additions & 1 deletion data/xquery_types.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2353,7 +2353,7 @@ end;

function TXQBoxedValue.toXQuery: string;
begin
result := qualifiedTypeName(toString, '', '', true );
result := toString;
end;

function TXQBoxedValue.toString: string;
Expand Down Expand Up @@ -2485,6 +2485,11 @@ begin
else result := local;
end;

function TXQBoxedQName.toXQuery: string;
begin
Result:='xs:QName("'+toString+'")';
end;


procedure TXQValueDateTimeData.initFromMicroSecondStamp(mics: int64; const tz: integer);
begin
Expand Down Expand Up @@ -2820,6 +2825,11 @@ begin
end;
end;

function TXQBoxedDateTime.toXQuery: string;
begin
Result:=qualifiedTypeName(typeAnnotationType.name, toString, '', true );
end;

function TXQBoxedDateTime.clone: TXQBoxedDateTime;
begin
result := TXQBoxedDateTime.create(typeAnnotationType, value);
Expand Down

0 comments on commit 8889d6a

Please sign in to comment.