xml to html - using xsl in html - xml xsl
- The XSL and XML will work only in server side code. So, we should use web server to run this code.
- To Know about XSL, XML to HTML we should know basics things these technical terms.
- The XSL (eXtensible Stylesheet Language) is used to describe the styles for displaying XML.
- The XSL defines the styles for the XML file elements and data that could be viewed in web browser.
- The styles can be reused, so describe the styles in a single file that will be used in many XML files.
- The XML (eXtensible Markup Language) is used to describe collection of data.
- The XML code is w3c recommended format.
- The XML structure contains nested of elements. The outermost element is called root element.
- Each element has starting and ending tags.
- The HTML (HyperText Markup Language) is used to show the webpage contents like text, images, video and others.
- The HTML contents are displayed in Web browser.
Sample coding for tutorial.xsl:
Code Explanation for tutorial.xsl :
- Version of xml and its version declared.
- version of XSL and namespace from w3 has been declared.
- For each element inside the wikitechy_tutorial as tutorial will be called in a loop for formatting.
- Styles for design the heading will be declared in <div> tag.
- Value of tutorial topic will get from XML file.
- Value of tutorial description will get from XML file.
- We can add our own text for each data get from the XML file.
Sample coding for HTML Grid:
Code Explanation for HTML Grid:
- The “wikitechy_tutorial” is Root element of the XML file all elements should be inside this element.
- Tag for HTML tutorial like topic and its description.
- Tag for CSS tutorial like topic and its description.
- Tag for PHP tutorial like topic and its description.
Output for HTML Grid:
- Set of styles has been applied to the tutorial topics and its description.
Browser Support for XSL XML TO HTML