emanuele
emanuele

Reputation: 2589

basics steps in converting xml file to html file

I would like convert a xml file to a html file. Where i can find a step by step tutorial (for linux) to do this in shell script, or which are the steps to follow. Sorry for the very basic question, but i am an absolute begginer on this. thanx

Upvotes: 4

Views: 17788

Answers (2)

gioele
gioele

Reputation: 10205

The basic tools to do this is XSLT.

XSLT is a language that you can use to describe how XML elements should be converted into HTML elements. Once you have an XSLT files that suits your need (you will have to write it), you can use the xsltproc utility to convert that XML files into HTML files.

How to write the XSLT transformation files depends on the exact kind of XML file you must translate. There are already-made XSLT-to-HTML transformation files for many formats, search for "[your format] xslt to html".

You can learn more about XSLT in W3Schools tutorials.

The xsltproc utility is available for most Linux distributions.

Upvotes: 6

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799150

You can use XSLT to map XML tags to HTML tags or fragments. There is no step-by-step guide on how to do this since the exact XSLT stylesheet to create depends on both what your XML looks like and what you want your HTML to look like. Once you have your stylesheet you can use xsltproc (part of libxslt) from the command line, or you can use the XSLT facilities available to most programming languages.

Upvotes: 0

Related Questions