Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Distribution/wwDotnetBridge.PRG
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ ENDFUNC
*** the data
*** Return: DataSet or NULL
************************************************************************
FUNCTION CursorToDataSet(lcAliasList)
FUNCTION CursorToDataSet(lcAliasList,fixemptydates)
LOCAL lnX, lcXml

IF EMPTY(lcAliasList)
Expand Down Expand Up @@ -1253,6 +1253,20 @@ IF EMPTY(lcXml)
RETURN null
ENDIF

IF fixemptydates
* add nillable=true to xds part of xml for date and Datetime fileds
lcXml= STRTRAN(lcXml,'type="xsd:date"' ,'type="xsd:date" nillable="true"') && dates
lcXml= STRTRAN(lcXml,'type="xsd:dateTime"' ,'type="xsd:dateTime" nillable="true"') &&dateTime
*delete all self closeing <fName/> tags for date fileds from the xml
FOR lnX = 1 TO lnCount && loop lcAliasList
FOR Lnxfldloop = 1 TO AFIELDS(afldsarr,laCursors[lnX]) && loop Fields
IF INLIST(afldsarr(Lnxfldloop ,2),"D","T")
lcXml= STRTRAN(lcXml, '<'+LOWER(afldsarr(Lnxfldloop ,1) )+'/>' ,'')
endif
endfor
ENDFOR
ENDIF

RETURN THIS.XmlStringToDataSet(lcXml)
ENDFUNC
* CursorToDataSet
Expand Down Expand Up @@ -2165,4 +2179,4 @@ ENDFUNC
************************************************************************
FUNCTION InitializeDotnetCoreVersion(lcVersion)
RETURN GetwwDotnetCoreBridge(lcVersion)
ENDFUNC
ENDFUNC