nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

Microsoft XML Core Services (MSXML) 4.0 - XSLT Developer's Guide

Use CSS in XSLT

The XSLT language allows you to manipulate and transform data. An XSLT style sheet handles data presentation with HTML tags, as shown above, when the output is in HTML format. You can also use Cascading Style Sheets (CSS) to format data, just as you would with an ordinary HTML page. The following example uses CSS within an XSLT style sheet.

To add a CSS style sheet to the Transform.xsl file

  1. In the XSLT style sheet you created in the previous step, add a <style> element with CSS style declarations within the <head> element. The <style> element should appear after the <title> element, as follows:
             <head>
                <!-- Referencing a data value as element content: -->
                <title><xsl:value-of select="//summary/heading"/></title>
                <style>
                    H1 {background-color:black; color:gold;}
                    .desc {color:blue; font-style:italic}
                </style>
             </head>
  2. Replace
     <p><xsl:value-of select="//summary/description"/></p>

    with the following statement:

     <p class="desc"><xsl:value-of select="//summary/description"/></p>
  3. Save the XSLT file and refresh the Sales.xml file in Internet Explorer.

The next exercise shows how to Perform Iterations — that is, how to work with a set of elements.


Download de SDK