English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 17 November 2011, 13:54   #1
amiga_user
 
Posts: n/a
xml parsing in arexx

Can someone help me parse the attached xml file with arexx, please ?
Attached Files
File Type: lha xmlfile.lha (285 Bytes, 184 views)
 
Old 17 November 2011, 14:31   #2
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,292
Code:
/* rexx */

if Open(in,"jamendo.xml",read) then do
	xml = ReadCh(in,65535)
	call Close(in)
end

x = index(xml,"<album>")
do while (x > 0)
	y = index(xml,"</album>",x)
	album = substr(xml,x+7,y-x-7)
	parse var album,
		1 "<id>" id "</",
		1 "<name>" name "</",
		1 "<url>" url "</",
		1 "<image>" image "</",
		1 "<artist_name>" artist "</"

	say "id     =" id
	say "name   =" name
	say "url    =" url
	say "image  =" image
	say "artist =" artist
	say ""

	x = index(xml,"<album>",y)
end
thomas is offline  
Old 17 November 2011, 15:42   #3
amiga_user
 
Posts: n/a
Thanks a lot, Thomas !!
 
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Up to date Software database (XML) dmweb project.SPS (was CAPS) 8 30 May 2016 20:22
Updated WHDLoad.xml for WinUAELoader? Clark Kent project.Killergorilla's WHD packs 56 30 October 2014 09:47
error parsing global configuration file line 16 DDNI project.WHDLoad 7 21 March 2011 13:09
Arexx redblade request.Apps 2 30 August 2006 11:51
Converting Microfiche Filer Plus to XML Vidman New to Emulation or Amiga scene 12 16 March 2004 17:29

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.07069 seconds with 16 queries