AnsweredAssumed Answered

ASP.Net child page with XSLT

Question asked by stephenr85 on Apr 4, 2008
Latest reply on Apr 22, 2008 by kvc
I am trying to generate an ASP.net child page with a Web Form content type. Here are the issues I'm having:

    1. The Page directive has no namespace or closing tag, and is therefore "malformed". When I place it in a CDATA, the angle brackets are converted to </>.
    2. The name spaces are being inserted into each of the "asp:Content" (content placeholder) tags.
Here is the generated .aspx file's contents:

<%@ Page Language="C#" MasterPageFile="~/master/pages/sub.master" Title="" %>

<asp:Content xmlns:asp="http://www.microsoft.com/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ktbu="http://ktbu/" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" Runat="Server" ID="cLeftNav" ContentPlaceHolderID="cphLeftNav">
<asp:Xml runat="server" TransformSource="/master/form/secondary-nav.xsl" ID="xmlSecondaryNav" DocumentSource="/test-nav.xml"/>
</asp:Content>
<asp:Content xmlns:asp="http://www.microsoft.com/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ktbu="http://ktbu/" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" Runat="Server" ID="cAdsLeft" ContentPlaceHolderID="cphAdsLeft">
<h1>test title</h1>
</asp:Content>

The ideal solution would be to control this from the XSL. If that's not possible, I'd like to be able to parse the XSL output before the aspx file is generated. This technique is shown here: http://www.codeproject.com/KB/XML/xmlxsltransformer.aspx (look for the "get transformed results" comment).

Thanks to anyone that can help! - Stephen

Outcomes