Working with XML

wherzwaldo

1,000+ Posts
I have some data in XML that I would like to format into a spreadsheet, database, HTML page, or anything other than just the XML itself. Is there an easy way to do this? The XML data would change a lot so I need something that is easy to convert (i.e. I update the XML file and the database/spreadsheet/whatever updates automatically).

I have Office 2000
pukey.gif
with Access on my office computer, but I think I heard that Office 2003 is supposed to be XML-friendly.
 
If you open a xml file in both firefox and internet explorer it formats it pretty nicely and allows you to expand and contract the branches.
 
XML is fantastic stuff.

You can use XSL to transform XML into HTML or anything. Just yesterday I transformed a lot of XML data into a series of SQL statements to inject into a database.

There are a couple of drawbacks -

1.) XSL/T isn't handled the same in IE and Mozilla. You might look into serverside transform to fix that.
2.) Stylesheets can break if the structure (as opposed to data) of the XML document changes.

#2 is very important. If you can settle on a structure for the XML document you can easily modify the XML document and have the stylesheet painlessly transform it. The data can change without having to change the stylesheet, but the underlying XML structure can't. Each time you change the XML structure (i.e. if you want to add a new type of tag or attribute or change node relationships) you will need to modify the stylesheet to accomodate that change.

Read up on XSL/T. That is probably what you are looking for.
 
IE vs Mozilla isn't a problem because we only use IE at work. Also, the structure won't change much if at all, although more data will be added at the end.

How hard is it to learn XSLT? If I'm familiar with CSS will it be too difficult?
 

Weekly Prediction Contest

* Predict HORNS-AGGIES *
Sat, Nov 30 • 6:30 PM on ABC

Recent Threads

Back
Top