Transform XML into HTML Using XSLT
page 1 of 4
Published: 04 Jun 2007
In this article Haissam Abdul Malak examines how to output an HTML page from an XML file using XSLT.
by Haissam Abdul Malak
Average Rating: 
Views (Total / Last 10 Days): 38133/ 51


For demonstration purposes, we will create a simple search engine in which XSLT is used to iterate through the XML file (data retrieved from the database) to display the data based on the user entered criteria. It consists of user information, such as First Name, Last Name, Email, etc. Also we will give the user the ability to search in a specified category and in which order the data should be displayed. This option is hidden by default; a button is used to allow the user to specify more options to his or her search.

Throughout this article we have to complete the following steps.

·         Create an XML document containing users' information.

·         Create an XSL file which will navigate through the XML document.

·         Write code behind to transform the XML into HTML.

View Entire Article

User Comments

Title: sql server   
Name: rajesh kumar jha
Date: 2011-07-23 8:33:12 AM
this is a very good database for
Title: .net to java   
Name: rajesh jha
Date: 2011-07-23 8:31:35 AM
this is very good site for all proggramer
Title: Hi   
Name: Pavan
Date: 2011-05-04 8:58:55 AM
this is the best site
Title: xml to html   
Name: Saravanan
Date: 2011-02-21 1:42:31 AM
Hi all,

i am currently into module where i need to convert a Indesign layout to a web page, i need to get the same design as html, what is there in the Indesign layout.

Please anyone help me

Title: tes   
Name: trial
Date: 2010-10-06 1:20:11 AM
user friendly
Title: Short Title   
Name: test
Date: 2009-09-17 6:38:43 AM
this is a test for xml to html conversion and i just wana test how it will finally look like in the html version..
This has to happen through xslt transformations and user have the option to search in xml file using this option..
Title: xml document to html document   
Name: Bertrand Gillert
Date: 2009-06-30 1:50:14 PM
Hi! We need to create a HTML preview for translation of a complicated catalog. The source is xml, we even have a .xsl. But the .xsl does not display the pictures (which we also have). The xml contains the product ids, the picture file names correspond to the product id. Is there a way to map the product ids to the file names and display the pictures within the loop?
Title: xml document to html document   
Name: Andy Symonds
Date: 2009-06-03 5:00:27 PM
hi erm im tryin to make an xml document into html document the xml document is a conversation over a months period i tried to open it to read it like the other files (the html files) but it wont let me so can u tell me how i could sort this problem out
Title: Embedding XML/XSL source   
Name: Matt
Date: 2009-04-30 12:20:28 AM
It is possible to embed the xml/xsl sources with in the executable itself. Imagine in your particular example that SearchEngine.Xsl and SearchEngine.xml were propriatary. Could you somehow embed these files as .NET resources or something such that the ultimate user of the .NET executable could not read the content of the xml/xsl files?
Title: Test   
Name: Kani
Date: 2009-03-28 9:04:17 AM
Test for XML to HTML Document
Title: testvipul   
Name: testvipul
Date: 2009-02-06 3:28:47 AM
this is a test for xml to html conversion and i just wana test how it will finally look like in the html version..
This has to happen through xslt transformations and user have the option to search in xml file using this option..
Title: feedback for Haissam Abdul Malak article   
Name: kannan from india
Date: 2008-11-06 1:15:58 AM
i have one question, may be u can help me..
how to add images include in this xslt and convert to html..
Title: how to Write code behind to transform the XML into HTML.   
Name: Jagadeesh
Date: 2008-05-29 5:35:47 AM
How to write code to convert from xml to html
Title: Article is very good but Not working for me.   
Name: Sushil Dhanuka
Date: 2008-04-22 8:20:44 AM
Hi Haisaam,

This article is very good but somehow not working for me as I made small changes. I am loading this XSL and XML file directly in HTML using javascript. I do not get any search results.

If you can send me email where I can attach my XSL and HTML files.

It would be very helpful for me.

Thanks in advance

Kind Regards
Title: Good one to know XSLT   
Name: Anjaneya
Date: 2008-02-12 6:55:04 AM
Good Article
Title: Prefix add in URl   
Name: Mukesh
Date: 2007-12-27 4:32:31 AM
how to add the prefix http if it not added by user.
if user write it convert to
Title: Please help on xslt   
Name: Bao
Date: 2007-12-07 4:46:29 AM
Hi Abdul Malak,

I have a question maybe you can help,

Is it possible to read from an HTML form (like the ones that you have on the internet to register to forums, etc) and yo save it into a xml file with XSLT by clicking on a button 'save'?

many thanks for your help !

Title: Very good.   
Name: Jignesh raval
Date: 2007-11-27 7:08:00 AM
I have read your artical, you have explained in such a good manner, very nice and very usefull.

Thank you.

Jignesh Raval, India
Title: Beautiful   
Name: Guido
Date: 2007-07-11 2:26:38 PM
Nice explanation. Hopefully I would be able to change it for my project
Title: Transform XML into HTML Using XSLT   
Name: chanchal choudhary
Date: 2007-06-11 12:46:33 AM
Really good and complete help which satisfies its title completely
Amust read for people who are new to xml transform
Title: Re:Missing Information   
Name: Haissam Abdul Malak
Date: 2007-06-04 11:26:34 AM
check the below link to download the project

Title: Missing Information   
Name: Jim Arthur
Date: 2007-06-04 9:45:25 AM
From your article under Javascript section "To check how to embed JavaScript inside XSLT, please download the project file."
So, where is the download link?
Title: Nice one!   
Name: Bilal Haidar [MVP]
Date: 2007-06-04 9:21:40 AM
Nice article as usual!
I am still waiting for the series ;)


Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-24 12:43:53 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search