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 (permalink)  
Old 07-21-2007, 03:02 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo 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
Sponsored Links
  #2 (permalink)  
Old 07-21-2007, 03:03 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
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 (permalink)  
Old 07-21-2007, 03:04 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo 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 (permalink)  
Old 07-21-2007, 03:10 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
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 On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 03:08 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0