<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
File: Default.aspx.vb
Imports System.IO
Imports System.Xml
Imports System.Xml.XPath
Imports System.Xml.Xsl
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load
Response.ContentType = "text/xml"
Dim xsltFile As String = Path.Combine(Request.PhysicalApplicationPath, _
"Data.xsl")
Dim xmlFile As String = Path.Combine(Request.PhysicalApplicationPath, "Data.xml")
Dim xslt As New XslCompiledTransform() 'Pass in true to enable XSLT Debugging
xslt.Load(xsltFile)
Dim doc As New XPathDocument(xmlFile)
xslt.Transform(doc, New XmlTextWriter(Response.Output))
End Sub
End Class
File: Data.xml
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
publicationdate="1981"
ISBN="1-11111-11-0">
title 1
A
B
8
publicationdate="1999"
ISBN="0-222-22222-2">
title 2
C
D
11.99
File: Data.xsl