Re: [Oberon] Oberon XML aggravation - and solution
jmdrake_98@yahoo.com wrote: Anyway I was doing a simple test of building an XML object then writing it to the AOSLog using the XML Content.Write method. This worked fine under Native BlueBottle, but under the Windows version I only got the last line of the XML document displayed. The problem? Well the author of the XML packages used AosIO.Write(w, CR) all over the place. Under Native BlueBottle this is fine, but under the windows version it should be AosIO.Write(w, CRLF). I changed all of these calls to AosIO.Ln(w) I also mentioned that already to Thomas Frey of ETH. When I tested with the Linux cadaver WebDAV client I only saw funny lines in the trace printout. C is taking the CRs literally as CRs :-) I changed something in a routine in XML.Mod so that <property>... some characters ...<property/> appears on the same line. Ask frey@inf.ethz.ch for the current version if you are interested. Also it would be nice to indent the element structure on writing ... :-)
Cheers, Edgar -- edgar@edgarschwarz.de "http://www.edgarschwarz.de" "http://www.edgar-schwarz.de/forum/oberon" Running Active Oberon Make it as simple as possible, but not simpler. Albert Einstein
Hello all, I've finished a working XMLRPC client! (See http://www.xmlrpc.org). XMLRPC is the predecessor to SOAP. But it's much simplier. For some reason I kept getting "permission denied" when I tried to upload it to the incoming folder at ETH. Anyway I've emailed it to them so hopefully it will be up soon. It was more work than I expected. My first thought for sending the XML accross the net was to implement an AosIO.Writer with an AosTCP.Connection.Send delegate. But that simply didn't work. Plus I noticed that AosIO.Writer.String makes repeated calls to the Send delegate proceder (one for each charecter in the string). It's much better in this instance to send all of the bytes in a group, so I called Send directly. There more that I learned on this project, but this is what stuck out in my mind. Anyway while it "works" it still can use some improvement. Also it would be nice to see someone implement a server also. Regards, John M. Drake __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
My first thought for sending the XML accross the net was to implement an AosIO.Writer with an AosTCP.Connection.Send delegate. But that simply didn't work. What is the problem with that ? HTTP/FTP/SMTP/QUOTE/etc. all use a AosIO Writer on a TCP sonnection. (Did you maybe miss the AosIO.Writer.Update ?
Plus I noticed that AosIO.Writer.String makes repeated calls to the Send delegate proceder (one for each charecter in the string). It's much better in this instance to send all of the bytes in a group, so I called Send directly. The AosIO.Writer.String only calls AosIO.Writer.Char for each character, not Send. This then only calls the Send delegate if its buffer is full. So sending (more than one) string/integer/etc. is probably faster via the AosIO.Writer since the number of network packets is reduced, compared to calling AosTCP.Connection.Send manually. The overhead of adding thousands of Char to the buffer is minimal compared to wasting one single network packet (at least for computers with more than very few MHz)
--Thomas
--- Thomas Frey <frey@inf.ethz.ch> wrote:
My first thought for sending the XML accross the net was to implement an AosIO.Writer with an AosTCP.Connection.Send delegate. But that simply didn't work. What is the problem with that ? HTTP/FTP/SMTP/QUOTE/etc. all use a AosIO Writer on a TCP sonnection. (Did you maybe miss the AosIO.Writer.Update ?
I think I remembered to do this, but I didn't keep this under version control so I can't go back and check. When I have time I'll try to do it this way again and see what happens.
Plus I noticed that AosIO.Writer.String makes repeated calls to the Send delegate proceder (one for each charecter in the string). It's much better in this instance to send all of the bytes in a group, so I called Send directly. The AosIO.Writer.String only calls AosIO.Writer.Char for each character, not Send. This then only calls the Send delegate if its buffer is full. So sending (more than one) string/integer/etc. is probably faster via the AosIO.Writer since the number of network packets is reduced, compared to calling AosTCP.Connection.Send manually. The overhead of adding thousands of Char to the buffer is minimal compared to wasting one single network packet (at least for computers with more than very few MHz)
--Thomas
My mistake. I misread the source of Char. Regards, John M. Drake __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
--- Thomas Frey <frey@inf.ethz.ch> wrote:
My first thought for sending the XML accross the net was to implement an AosIO.Writer with an AosTCP.Connection.Send delegate. But that simply didn't work. What is the problem with that ? HTTP/FTP/SMTP/QUOTE/etc. all use a AosIO Writer on a TCP sonnection. (Did you maybe miss the AosIO.Writer.Update ?
Ok, I tried it again and this time I was able to write to the TCP connection using a writer. This cleaned up my code some. One thing that's still weird. If I try to send the XML string via xml.Write(writer) it hangs up. What I did instead was create a Send delegate that "writes" the XML to a string and then I use writer.String(xmlstring). In a way I need to do the string coversion anyhow because I need to pass the length of the XML string to XMLRPC, so it's not a big deal. Anyway thanks for your input. Regards, John M. Drake __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
participants (3)
-
Edgar@EdgarSchwarz.de -
John Drake -
Thomas Frey