• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Transforming Xml Data Into Html
 

Transforming Xml Data Into Html

on

  • 2,388 views

Transforming XML data into HTML Markup

Transforming XML data into HTML Markup
by
http://www.livetolearn.in

Statistics

Views

Total Views
2,388
Views on SlideShare
2,178
Embed Views
210

Actions

Likes
0
Downloads
21
Comments
0

4 Embeds 210

http://www.livetolearn.in 188
http://www.slideshare.net 13
http://livetolearn.in 8
http://localhost 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Transforming Xml Data Into Html Transforming Xml Data Into Html Presentation Transcript

    • Transforming XML data into HTML http://www.livetolearn.in
    • XSL
      • An Extensible stylesheet Language (XSL) transformation pulls data from XML nodes and renders the content according to given instructions
      • We can render the raw data as attractive HTML on an ASP.NET page.
      http://www.livetolearn.in
      • Add a new XML file named links.xml to the App_Data folder
      • Enter the following sample data:
      <? xml version = &quot; 1.0 &quot; encoding = &quot; utf-8 &quot; ?> < links > < link > < title > Microsoft Official ASP.NET site </ title > < url > http://www.asp.net </ url > < description > The primary site for ASP.NET developers. </ description > </ link > < link > < title > Collection of Tutorials, Ebooks, Videos </ title > < url > http://www.livetolearn.in </ url > < description > Computer Programming Tutorials, Tutorial Sites, E-books, Videos, Powerpoint Presentations </ description > </ link > </ links > http://www.livetolearn.in
    • Add xslt stylesheet file in root folder and replace with the following content <? xml version =&quot;1.0&quot; encoding =&quot;utf-8&quot;?> < xsl:stylesheet version =&quot;1.0&quot; xmlns:xsl =&quot;http://www.w3.org/1999/XSL/Transform&quot;> < xsl:template match =&quot;/links&quot;> < xsl:for-each select =&quot;link&quot; > < p class =&quot;headingtitle&quot;> < xsl:value-of select =&quot;title&quot;/> </ p > < div class =&quot;content&quot;> URL: < xsl:value-of select =&quot;url&quot;/> </ div > Description: < xsl:value-of select =&quot;description&quot;/> < hr /> </ xsl:for-each > </ xsl:template > </ xsl:stylesheet > http://www.livetolearn.in
      • Add a asp.net page xmltohtml.aspx
      • Add a Xml Control from Toolbox
      • On the Xml control’s property window set the following properties
      http://www.livetolearn.in
      • Now, add styles as you want with in <head> tag in the aspx file
      • For example add the following code or define it by clicking New Style in the sidebar
      < style type =&quot;text/css&quot;> .headingtitle { font-weight: bold; background-color: #FFFF00; border-style: ridge; } .content { background-color: #99CCFF; font-weight: bold; border-style: outset; } </ style > http://www.livetolearn.in
    • Now, browse it (F5 / Ctrl+F5) http://www.livetolearn.in