From: Haejoong L. <hae...@un...> - 2003-09-29 22:04:46
|
Marco, Sorry for the late answer. > I'm beginning studying agtk, and I wish to use Tcl wrapper. > I need your help for this problem I have. > Every function works fine except AG::Load. When I run this very simple > script: > > #!/usr/bin/tclsh > > package require ag > > set ag2 [AG::Load AG "demo1.xml"] > puts [AG::toXML $ag2] > > > I obtain only a segmentation fault. "demo1.xml" is the demo file I've > found in agapps-1.1.2/annotation/ dir, I've only changed DOCTYPE to > "ag.dtd" which is in the same dir of demo1.xml and of my script. It could be a bug in the ag library. I have had similar experience recently, especially on a RedHat machine. The version was 7.2, I think. I identified what lines of code caused the problem and was able to make it work right, but never figuired why. You can retrive the source from the CVS or simply copy the source file I'm attaching into your source directory (aglib-2.0/src/formats/AG) and build the library again. > Trying to open other xml files, I obtain messages like these: > > agf:An exception occurred! Type:UTFDataFormatException, Message:invalid > byte 2 ( ) of a 3-byte sequence. > LoadErroragf:An exception occurred! Type:UTFDataFormatException, > Message:invalid byte 2 ( ) of a 3-byte sequence. > while executing > "AG::Load AG "read.xml"" > invoked from within > "set ag2 [AG::Load AG "read.xml"]" > (file "./provaagtk.tcl" line 5) This is a different problem. The loader seems to be expecting an UTF-8 files. The file you tried to load was in UTF-8? Then the file was corrupted. If it was not UTF-8 and you know what encoding it is, specifying that encoding in the file might solve the problem, e.g.: <?xml version="1.0" encoding="ISO-8859-1" ?> <AGSet ...> ... Please let me you how you worked out. Thanks, Haejoong |