So I am using the below code to do a xslt transformation. But I am pretty new to ASP.NET development so the errors are slightly misleading. This code is generating an error that states it doesn't understand physical paths and only virtual paths. What is a virtual path and how do I make one from a specified physical path?
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="ViewerASP.SiteMaster" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<%@ Import Namespace="System.Xml.XPath" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title>Viewer</title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<script language="C#" runat="server">
public void Page_Load(Object sender, EventArgs E) {
string xmlPath = Server.MapPath("physicaladdresshere");
string xslPath = Server.MapPath("physicaladdresshere");
//Instantiate the XPathDocument Class
XPathDocument doc = new XPathDocument(xmlPath);
//INstantiate the XslTransform Class
XslTransform transform = new XslTransform();
transform.Load(xslPath);
//Custom format the indenting of the output document using XmlTextWriter
XmlTextWriter writer = new XmlTextWriter(Response.Output);
writer.Formatting = Formatting.Indented;
writer.Indentation=4;
transform.Transform(doc,null,writer);
}
</script>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
</body>
</html>
physicaladdressherelook like? Is it relative or absolute? If relative - to what directory?