How to convert this XML into HTML?

4 replies
  • WEB DESIGN
  • |
I have this XML file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Diary>
<Event EventName="J.Edgar" Classification="2011 Movies" EventStart="2012-03-19T07:00:00+00:00" EventEnd="2012-03-19T08:00:00+00:00" />
<Event EventName="Titanic" Classification="1997 Movies" EventStart="2012-03-19T09:00:00+00:00" EventEnd="2012-03-19T10:00:00+00:00" />
....
</Diary>
How can I create an automatic table (with HTML and CSS)? these details of EventName, etc.. are automatic and I need something Dynamic for it.

I tried using W3 tutorials but didn't manage to get anything out of it. This XML file looks different than regular ones as well.

Please let me know if you have an idea.
Many thanks!
#convert #html #xml
  • Profile picture of the author IMBotz
    Are you looking for a solution to automate the conversion? I could write a tool depending on the time needed.
    {{ DiscussionBoard.errors[5857245].message }}
  • Profile picture of the author Earnie Boyd
    Do you have PHP experience? PHP has an XML Parser you could use to read the file to output the contents. See php.net/xml for the manual.
    Signature
    {{ DiscussionBoard.errors[5857987].message }}
  • Profile picture of the author GlennTube
    Best way to do it would be like Earnie Boyd said, use PHP. You would load the XML into PHP with the XML parser, then run a foreach loop through the events. Inside each loop you would get the attributes and output them in a html table format. Using it would be as simple as pasting the XML into a text block and pressing convert once it's all setup.

    Easy when you know how!
    {{ DiscussionBoard.errors[5862079].message }}
  • Profile picture of the author raitman
    Php is definitely the way to go.
    Signature
    Overwhelmed with information overload on Internet Marketing??? I hear you!!!
    Access this $39 report for FREE. Why? Cuz I'm in a good mood and you deserve it.
    A MUST report for the seasoned or newbie. $1477 a week is DOABLE.
    No experience needed. Just a will to succeed.
    {{ DiscussionBoard.errors[5874473].message }}

Trending Topics