(9.2.2) Reading until the end of a file
(9.2.2) Reading until the end of a file
- Subject: (9.2.2) Reading until the end of a file
- From: Steve Thompson <email@hidden>
- Date: Tue, 03 Sep 2002 12:28:42 +0100
I have an agent running on a Lotus Domino server that returns a number of
results in XML format. I am using URL Scripting to get this data and then I
am hoping to parse it using the XML OSAX. However, I'm having trouble
reading the file created by URL Scripting...
For example,
download "
http://domino2/REDA/xmlpasst.nsf/XMLApprovedOrders?OpenAgent"
to file "Steve:Desktop Folder:Query Results" replacing yes with progress
--> file "Steve:Desktop Folder:Query Results"
Returns a file that contains:
<?xml version="1.0" encoding="UTF-8" ?>
- <approvedorders>
- <ordercode orderid="ORD000426">
<orderdocunid>FDEDDCCBFD95BE7880256BC60046D4CE</orderdocunid>
<publication>Aire Valley Target</publication>
<insertiondate>31/05/02</insertiondate>
<urnnumber>Client310502Aire Valley Target</urnnumber>
</ordercode>
</approvedorders>
However, a bit further on my script says:
get eof file "Steve:Desktop Folder:Query Results"
--> 322.0
read file "Steve:Desktop Folder:Query Results" until 322.0
--> "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<approvedorders>
<ordercode orderid='ORD000426'>
<orderdocunid>FDEDDCCBFD95BE7880256BC60046D4CE</orderdocunid>
<publication>Aire Valley Target</publication>
<insertiondate>3"
Get eof returns the correct file size, but read file <xxx> until <eof value>
doesn't work. It doesn't seem to return the file to it's eof. Even if Get
eof erroneously returned the file size, that would still be greater that the
amount of text in the file.
Can anyone tell me the correct way to read an entire file in to a variable
in one go? Or tell me why this doesn't seem to be working properly?
Thanks,
Steve
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.