IT Community - Software Programming, Web Development and Technical Support

Can anyone explain what is XSL ?

This is a discussion on Can anyone explain what is XSL ? within the XML and SOAP forums, part of the Web Development category; Can anyone explain what is XSL ?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > XML and SOAP

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-21-2007, 02:02 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 880
kingmaker is on a distinguished road
Send a message via MSN to kingmaker
Question Can anyone explain what is XSL ?

Can anyone explain what is XSL ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 07-21-2007, 02:03 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 631
oxygen is on a distinguished road
Smile Re: Can anyone explain what is XSL ?

We can use the XSL to define how an XML file should be displayed by transforming the XML file into a format that is recognizable to a browser.
One such format is HTML.
Normally XSL does this by transforming each XML element into an HTML element.XSL can also add completely new elements into the output file, or remove elements. It can rearrange and sort the elements, test and make decisions about which elements to display, and a lot more.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 07-21-2007, 02:04 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 880
kingmaker is on a distinguished road
Send a message via MSN to kingmaker
Question Re: Can anyone explain what is XSL ?

How to apply the XSL to a XML file ? do u have any sample
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 07-21-2007, 02:10 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 631
oxygen is on a distinguished road
Smile Re: Can anyone explain what is XSL ?

for sample take the below XML. In the second line it calls the XSL stylesheet (test.xsl".I'll give the XSL file below for this XML. when u noramlly open a xml the browser will display the xml content,now after apply the stylesheet,it will display the XML content in a table format

XML file
<?xml version="1.0" encoding="ISO8859-1" ?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
</catalog>


XSL File
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>
<table border="2" bgcolor="yellow">
<tr>
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="CATALOG/CD">
<tr>
<td><xsl:value-of select="TITLE"/></td>
<td><xsl:value-of select="ARTIST"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Explain OPENXML? devarajan.v XML and SOAP 6 07-14-2010 07:17 PM
MTU Explain srikumar_l Networking & Internet Connectivity 0 12-17-2007 07:51 PM
:confused: plz explain........ gk_cloud PHP Programming 2 10-12-2007 02:13 AM
Explain why encapsulation is required? vigneshgets C and C++ Programming 1 08-01-2007 02:10 AM
Explain QTP Testing process itbarota Testing Tools 2 07-24-2007 02:59 AM


All times are GMT -7. The time now is 12:38 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
Stamford Dentist | Euro Millions Lottery | Tech Support Services

SEO by vBSEO 3.0.0