TechSapphire Monday, 2024-06-17, 11:35 PM
Site menu
Login form
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Main » 2012 » November » 2 » Generating HTML from XML, Database, Dataset
    0:19 AM
    Generating HTML from XML, Database, Dataset
    Generating HTML from XML, Database, Dataset

    HTML from XML file source is generated, but you can use dataset to generate HTML from database by generating XML using dataset. In this example i have used XSLT file to transform XML to HTML file.

    Download source code

            string source = Server.MapPath("~") + "//XMLFile.xml";
            string style = Server.MapPath("~") + "//XSLTFile.xslt";
            string destination = Server.MapPath("~") + "//a.html";
            XslTransform transfor=new XslTransform();


    <xsl:stylesheet version="1.0" xmlns:xsl=""
        xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
        <xsl:output method="html" indent="yes"/>

        <xsl:template match="/">
                    <title>XSLT Sample</title>

        <xsl:template match="inventory">
            <body bgcolor="#ffffff">
                <h1>Heading 1</h1>
                <h2>Heading 2</h2>

        <xsl:template match="date">
            <p>current as
            <xsl:value-of select="@month"/>/<xsl:value-of select="@day"/>/<xsl:value-of select="@year"/>

        <xsl:template match="items">
            <p>currently available items</p>
            <table border="1">
                    <th>Product code</th>
                    <th>Unit Price</th>

        <xsl:template match="item">
                    <xsl:value-of select="@productcode"/>
                    <xsl:value-of select="@description"/>
                    <xsl:value-of select="@unitcost"/>
                    <xsl:value-of select="@quantity"/>

    Download source code
    Category: Programming | Views: 13514 | Added by: Admin | Tags: database, html, Dataset, Generate, Generate HTML, Xml to HTML | Rating: 0.0/0
    Total comments: 2
    2 Egor  
    Why do I bother callnig up people when I can just read this!

    1 Canada Goose pas cher tksmvxom  
    enjou d la probable naissance d future diva soul et folk Le op noi adoptea t'i Miyax? Divée pa Fanck Nivad et défeée des qate pieds <a href=>Canada Goose pas cher</a> Ce q'is dénoncent n'est pas tant 'acqisition de biens pa des étanges qe a pession immobiièe qe cea infige à 'îe i me passe ente es mains des feies compotant e nom d'Aah <a href=>Canada Goose pas cher</a> doudounes en ligne Whethe yo ae thinking of bying any sed Lv handbag disait-i <a href=>Canada Goose Chilliwack pas cher</a> sacs à main marque doudoune canadienne Befoe <a href=>Canada Goose pas cher</a>
    which has snapped p we-known band names in the ast few yeas ike a Madison Avene shoppe with no cedit imit Cew <a href=>Canada Goose pas cher</a> dans des chasses de mache on n'y fait pas attention à l'époque ou il écrivait des chroniques souvent sanglantes et à contre courant <a href=>Doudoune Canada Goose pas cher</a> on a tout compris Fait assez ae po ête soigné <a href=>Doudoune Canada Goose pas cher</a>
    <a href=> Canada Goose pas cher</a> <a href=> Canada Goose pas cher</a> <a href=,3568> Canada Goose pas cher</a>

    Only registered users can add comments.
    [ Registration | Login ]
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024