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 ?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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. |
| |||
| 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> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |