• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Converting XML Files

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

RedDragonXXX

Senior RAM Pornographer
Joined
Mar 3, 2005
Location
Jacksonville, FL
Is there a way to convert XML file to lets say a Word Document so that it includes all the formatting?

Reason I'm asking is I have these reports that I download from a website but they are all XML files which I can open with Word or Excel but all the formatting is missing and it just shows as plain text.
 
Is there a way to convert XML file to lets say a Word Document so that it includes all the formatting?

Reason I'm asking is I have these reports that I download from a website but they are all XML files which I can open with Word or Excel but all the formatting is missing and it just shows as plain text.

A bare XML file doesn't have formatting information. If there's an associated XSL (eXtensible Stylesheet Language) file, though, that is like CSS for HTML. Got a link to the source site? Probably several people here who could write up an XSL for you.
 
No XSL, just bare XML file.

I just ended up using one of the online free converter to CSV file and formatted the stuff that needed formatting myself. I just don't see why they export reports to XML file instead of CSV in the first place.
 
No XSL, just bare XML file.

I just ended up using one of the online free converter to CSV file and formatted the stuff that needed formatting myself. I just don't see why they export reports to XML file instead of CSV in the first place.

Because CSV is just a dumb list with no indication of how it should be sorted or what each item means. XML can be much more descriptive (though some people insist on abusing the format for things it is useless for).
 
I thought that XML was getting phased out in favor of JSON? I've worked with JSON before to delimit data (wrote small programs that do imports) and its a lot easier to read in raw format as compared to XML and also easier to work with. But still when ever I come to any type of reports and exporting its either XML and sometimes in CSV.
 
I thought that XML was getting phased out in favor of JSON? I've worked with JSON before to delimit data (wrote small programs that do imports) and its a lot easier to read in raw format as compared to XML and also easier to work with. But still when ever I come to any type of reports and exporting its either XML and sometimes in CSV.

Huh what? Data formats are data formats. They don't get "phased out". If you're talking about AJAX code often using JSON instead of XML, that's not really relevant. The only important bit there is the "Asynchronous Javascript". The "And Some-data-format" could be anything. AJAX should really just be AJ :) Also, JSON is only easier to read for simple data. For complex data, with lots of relations (e.g. a representation of a some RDBMS tables without any SQL-specific code), XML can be much more descriptive. XML also provides XSD for verification that all required elements are present, allows requiring them to be in a certain order, etc., and XSL(T) can present an XML document in a more human-readable "web page" format. With XML, you're guaranteed a certain level of structure. JSON has no such guarantee. Also, JSON deserialization can be a security vulnerability, since it can cause code execution. XML is never executed. Each has their place.
 
Back