Hi all,
I'm populating rowset column by calling a library method. This method
grabs some data based on the current record and does a "return thedata".
Using write to console, I see that the library method gets called
correctly, finds the correct data and appears to return this data.
However, rather than each row of the rowset having the data returned
for each record, every row is in fact populated with the data
returned for the very last call to the method (or the last record only).
i.e. I get something like this:
RowSet
#
bibShortRef
bibTransformedXML
1
Andrews 1920
Yang Jianxin, Ma Manli, Wai guo Kao ji jia zai wo guo xi bei: , .<br>
2
Andrews 1933
Yang Jianxin, Ma Manli, Wai guo Kao ji jia zai wo guo xi bei: , .<br>
3
Andrews 1935
Yang Jianxin, Ma Manli, Wai guo Kao ji jia zai wo guo xi bei: , .<br>
Anyone have any idea why this might be happening. Is the problem
returning data as a blob and if so why would it return the last
record's data correctly? Thoughts, suggestions much appreciated.
Regards, Michael.
A4D 4.0.0 rc5, 4D 2004.x, Mac OS 10.4.8
Here is the rowset code:
$map := """
bibShortRef:
[Bibliography]short ref;
bibTransformedXML:
`idp.utils.GetTransformedBiblioXMLBlob`
"""
C_longint($rowSet)
$rowSet := RowSet.newFromCachedSelection(->[Bibliography]; $map;
$maxRecords; ""; "bibliography"; 60 * 1) ` No callback, Persistent
for 1 hour
The library method is as follows:
method "GetTransformedBiblioXMLBlob"
//write to console('transformBibCalled')
C_text($baseDir;$text)
$baseDir := url to native path(join paths(get root ; "xslt"))
C_Blob($theBlob;$transformedBlob)
$theBlob := [Bibliography]XMLRecord
//write to console('shortref=`[bibliography]Short Ref` bib
blob=`blob size($theBlob)`')
if(blob Size($theBlob)#0)
$fullPath := join paths(get root ; "xslt"; "bibl.xsl")
if (Test path name($fullPath)=Is a document)
//write to console('transform bib blob (`blob
size($theBlob)`)')
document to blob($fullPath;$xlst_Stylesheet)
$transformedBlob := XSLT_Transformer($theBlob; $xlst_Stylesheet;
$baseDir) // apply stylesheet
`$text := blob to text($transformedBlob; text without
length)
end if
else
$text := "No data currently available"
TEXT TO BLOB ($text;$transformedBlob; text without length)
end if
if(blob Size($transformedBlob)=0)
$text := "Sorry an error occurred returning this Bibliography"
TEXT TO BLOB ($text;$transformedBlob; text without length)
End if
write to console($transformedBlob) ` this is correct at this stage
return ($transformedBlob)
end method
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/