Author Topic: RSS and XML  (Read 4165 times)

0 Members and 1 Guest are viewing this topic.

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 340
  • Karma: 16
  • kiss that sound that pounds your senses
    • View Profile
RSS and XML
« on: November 21, 2007 »
--edit... I attached XML files... not allowed. So I zipped them. Then clicked Submit, and it said - You have already submitted this post... but I couldnt find it in the forum? Sorry if this is a repeat!!! This is the post I would like to keep :) Thanks!

Hmmm... welcome me to the new and exciting world of RSS Feeds created with XML?

The system we are using to display the 'current song' on our web page is being changed from HTML to XML. My boss told me this, this morning (thats to this's... baaad!)

Does anyone know how to get data from a remote location, and display it using XML, RSS, or both? My boss and I have tried. I have attached both our efforts. Original is my boss's, the other - mine.

My boss's one gets the information perfect. But the XML tags are showing on the web page.
Mine... well... it doens't appear. It displays a RSS feed thingo... but has no other information.

The syntax to get the data (we are using the syntax required for out HitPlayer - the thing which runs our station :))
Code: [Select]
{PL1_SONG?}
{PL1_ARTIST?}
--where PL1 is PlayList1
Written like this:
Code: [Select]
<song_name>{PL1_SONG?}</song_name>
<song_artist>{PL1_ARTIST?}</song_artist>

Hope thats enough info.
Thanks!
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: RSS and XML
« Reply #1 on: November 21, 2007 »
...
Does anyone know how to get data from a remote location, and display it using XML, RSS, or both? My boss and I have tried. I have attached both our efforts. Original is my boss's, the other - mine.
...

Hey Clanky. I don't get you. What are you exactly trying to achieve ? Do you want to
download a XML file from the Internet and then read it ?

Greetz,
benny!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 340
  • Karma: 16
  • kiss that sound that pounds your senses
    • View Profile
Re: RSS and XML
« Reply #2 on: November 21, 2007 »
Nope.
What my boss has in mind is... we have a XML file located remotely on the server (because the new sms system will require it) and read the xml file from our web page (get it?)
The xml will hold the data collected from the commands (PL1_##) and display them.

It works with HTML, its just XML is wierd (to use for the first time... it doesn nothing yeah!?)
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: RSS and XML
« Reply #3 on: November 21, 2007 »
Sorry. Still don't get it - maybe because of too much beer.

Would a JavaScript / AJAX call be a solution ???
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline slippy

  • Atari ST
  • ***
  • Posts: 172
  • Karma: 42
    • View Profile
Re: RSS and XML
« Reply #4 on: November 21, 2007 »
Wouldn't some XSLT stylesheet transformation do the stuff for you?!?

;)

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 340
  • Karma: 16
  • kiss that sound that pounds your senses
    • View Profile
Re: RSS and XML
« Reply #5 on: November 23, 2007 »
Ok. Sorry I haven't explained it well  ;D
Ok...

The radio station I work at uses computer software to organise the days playlist, run through templates for that certain day.
Each song is categorised when entered into the database. The template uses these categories, as well as rules to make sure there is an even spread throughout the day.
Since the radio station is computerised... it is possible for us to use the players status of what track is currently playing. This is achieved by in-built software (or hardware I'm not sure ;)) with commands recognised by the player. We use specific commands to tell the player what to do (say stop, restart system, play...), and also to get information reguarding it.This is how we get the songs name, and artist.
We are able to create a HTML page (on our server) to be minipulated by the software (as we can tell the player: when a new song starts, get the songs name and artist, and where it says {PL1_SONG?} and/or {PL1_ARTIST?} in the HTML file, add the names respectively to the HTML file, and upload it to our server - hence we are able to display the HTML page on our website.)
But now, we need to use XML (so I'm told) instead of the HTML format.

I've never used XML, so I had to read up on W3C (ahh great!). Hmmm...
I tried to add a stylesheet - but when uploaded to the server, a message appears (instead of the information, or even the XML code) saying: "You cannot use Stylesheet Command (or something) with this page"...
My boss tried the RSS. And, sorry! But, I made a (well I think) better RSS solution. It was basically copied from the W3C site...

Hmmm... this is always all to confusing :P

Does that explain the situation better?
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: RSS and XML
« Reply #6 on: November 23, 2007 »
@Clanky:
Thanks for explaining it more detailed.

I think you should have a look on XSLT as sl!ppy already mentioned. Maybe this
technique is what you need.

You can seperate the pure information from the way it should be shown. The pure data
(e.g songname, command) can be stored in a simple well-formed XML file. With a
XSLT (Stylesheet Transformation Language) you are able to "browse" through
your xml-tree, accessing knots and even doing some conditional decisions and/or
tiny String-Manipulations (refer: XPath).

An XSL-Processer would use your XML and XSLT file as input files and produces any
file you want out of it. In your case it could be a normal xHTML file. Have a search
on google about it. Maybe this technique can become handy for you.

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 340
  • Karma: 16
  • kiss that sound that pounds your senses
    • View Profile
Re: RSS and XML
« Reply #7 on: November 24, 2007 »
Thanks Benny! I'll certainly check out the XSLT like Sl!ppy said :P
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..