Jump to content

DTD/XML to HTML


sgt_spike

Recommended Posts

As I went through the XML tutorials I kept thinking about a personal project I want to do at home.  I would like to turn my iTunes library into a webpage.  I just need a view only page, but something that could be automatically updated when items are added to the library.

You may already know iTunes uses an xml file to store metadata about media files in the library.  This xml has a dtd schema (<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">) identifying the structure of the xml (I learned this from the tutorials). 

I want to use the "iTunes Library.xml" to populate the web page, and since it already has a structure, I figured it would be easy to do.  The problem is I don't see how to do this.  Going through all the XML tutorials including the DTD tutorial, it's not clear on how to accomplish this.  I tried to reference the xml tags through the DOM, it worked once, giving me the tag type.  I also found that using the DOM on such a large XML could make the web page slow.  I know that I could use an xslt to format the xml but I would have to reference the xslt document in the xml.  Again I want it dynamic, so using the referenced iTunes dtd works.  I just can't determine how to go about doing this with the tutorials.  They didn't make it clear how to use the DTD to turn the xml into html

Any assistance would be greatly appreciated.  

Link to comment
Share on other sites

Which tutorials JavaScript or Server language such as PHP, JavaScript requires JavaScript enabled or you won't be apply display nothing, PHP reading of xml will always work. You probably need to incorporate filter of data from xml, restrict the data you want not all or instead of showing the complete list, you code restrict it 20, 50 at time PHP would be robust in doing this than JavaScript. You could also use both (again JavaScript must be enabled) through AJAX where JavaScript would connect to a PHP page, retrieve the content and place it where required, without reloading of page.

Link to comment
Share on other sites

I wanted to put it in JS but I'm willing to do something easier and better.  At this point, being a newbie at this, I'm pretty flexible, I just need some guidance.

 

I don't don't much about PHP, but willing to learn.  Would doing the PHP tutorial on W3schools give me the knowledge to accomplish this?

Link to comment
Share on other sites

To use PHP you require local server on your operating system that supports PHP.  XAMP (cross platform) or WAMP (windows only) software combining Apache (web server), MYSQL(database), PHP (server language) are the most popular.

OR

You can attempt to get a free web host server that uses Linux, Apache, MYSQL, PHP or pay for one, where you purchase a available website name of your chosen to run your site on plus testing.

You can go through w3schools PHP tutorial to learn and gain knowledge how to use php to communicate with MYSQL databases and there tables or text base XML files to display with html on your web pages.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...