SlideShare a Scribd company logo
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

More Related Content

PPT
1.1 xhtml basics
PPT
PPTX
How an html file is structured
PPTX
html 2017
PPTX
HTML to FTP
PPT
Learning Html
PPSX
Over view of html
1.1 xhtml basics
How an html file is structured
html 2017
HTML to FTP
Learning Html
Over view of html

What's hot (19)

PPT
Working with External CSS
PPT
PPT
Digital + Container List
PPSX
PPTX
Headings
PPT
1.2 elements and attributes copy (3)
PPTX
Class2
PPTX
Hyperlink
ODP
PPT
Html text formatting
PPT
Block2 Session2 Presentation
PPT
Krazykoder struts2 ui_tags
PPTX
Html_Day_One (W3Schools)
PPT
HTML Intermediate
PPT
HTML Advanced
PPTX
Html guide
Working with External CSS
Digital + Container List
Headings
1.2 elements and attributes copy (3)
Class2
Hyperlink
Html text formatting
Block2 Session2 Presentation
Krazykoder struts2 ui_tags
Html_Day_One (W3Schools)
HTML Intermediate
HTML Advanced
Html guide
Ad

Viewers also liked (20)

DOCX
Tec16grupo9 ide9610177 anexos1
PPTX
Daur baur Digital activation
PDF
Tramonex_Corporate Brochure (3)
PPTX
Enfoque cualitativo
PPTX
Tayammum
PPTX
Pengaruh jenis media tanam
PPTX
Salam tempel
PDF
Top100 Brands Single
DOCX
Alaa Bebars
PDF
Viral growth – presentation at European Innovation Academy 2015
PPTX
Savannah chatham (1)..
PPT
Beni culturali - Daniela Fiore
PDF
IPv6 deployment status
PPTX
Muchalucha
PDF
Factoring out system components – RAMP 2013
PDF
Towards an Open Data Center with an Interoperable Network (ODIN) : Volume 2: ...
PDF
Si Kecil Yang Berharga - A Campaign Against Smoking Around Children
PPTX
La perdurabilidad en las empresas familiares
PDF
Indonesia forest league - young lions 2013
DOC
Moto g 4
Tec16grupo9 ide9610177 anexos1
Daur baur Digital activation
Tramonex_Corporate Brochure (3)
Enfoque cualitativo
Tayammum
Pengaruh jenis media tanam
Salam tempel
Top100 Brands Single
Alaa Bebars
Viral growth – presentation at European Innovation Academy 2015
Savannah chatham (1)..
Beni culturali - Daniela Fiore
IPv6 deployment status
Muchalucha
Factoring out system components – RAMP 2013
Towards an Open Data Center with an Interoperable Network (ODIN) : Volume 2: ...
Si Kecil Yang Berharga - A Campaign Against Smoking Around Children
La perdurabilidad en las empresas familiares
Indonesia forest league - young lions 2013
Moto g 4
Ad

Similar to Transforming Xml Data Into Html (20)

PPT
XML and XSLT
PPT
Introduction to XML
PPT
PPT
Inroduction to XSLT with PHP4
PPT
Introduction to XML
PPT
PPT
Xml Schema
PPT
XML and Web Services with PHP5 and PEAR
PPT
PPT
XML processing with perl
PPT
PPT
Blogs and RSS
PPT
3 xml namespaces and xml schema
PPT
Introduction To Xml
ODP
Architecting Web Services
PPT
XML Transformations With PHP
PPTX
Php Mysql Feedrss
PPTX
Xml For Dummies Chapter 12 Handling Transformations With Xsl it-slideshares...
PPT
crystal xcelsius and web services by dashboardcafe.com
PPT
Extensible Stylesheet Language
XML and XSLT
Introduction to XML
Inroduction to XSLT with PHP4
Introduction to XML
Xml Schema
XML and Web Services with PHP5 and PEAR
XML processing with perl
Blogs and RSS
3 xml namespaces and xml schema
Introduction To Xml
Architecting Web Services
XML Transformations With PHP
Php Mysql Feedrss
Xml For Dummies Chapter 12 Handling Transformations With Xsl it-slideshares...
crystal xcelsius and web services by dashboardcafe.com
Extensible Stylesheet Language

Transforming Xml Data Into Html

  • 1. Transforming XML data into HTML http://www.livetolearn.in
  • 2. 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
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. Now, browse it (F5 / Ctrl+F5) http://www.livetolearn.in