Home All Groups Group Topic Archive Search About

XML/XSL transform problem

Author
25 Nov 2005 9:43 AM
Lasse Edsvik
Hello

I was trying to do this example shown here:

http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/ctrlref/webctrl/Xml/Xml2.src&file=CS\Xml2.aspx&font=3

When I run it I get 3 warnings and nothing shows in the browser, what might
be wrong?

Warning 1 'System.Xml.Xsl.XslTransform' is obsolete: 'This class has been
deprecated. Please use System.Xml.Xsl.XslCompiledTransform instead.
http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and
Settings\Administrator\My Documents\Visual
Studio\WebSites\XMLTest\Default.aspx.cs 20 9 C:\...\XMLTest\


Warning 2 'System.Xml.Xsl.XslTransform' is obsolete: 'This class has been
deprecated. Please use System.Xml.Xsl.XslCompiledTransform instead.
http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and
Settings\Administrator\My Documents\Visual
Studio\WebSites\XMLTest\Default.aspx.cs 20 34 C:\...\XMLTest\


Warning 3 'System.Web.UI.WebControls.Xml.Document' is obsolete: 'The
recommended alternative is the XPathNavigator property. Create a
System.Xml.XPath.XPathDocument and call CreateNavigator() to create an
XPathNavigator. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents
and Settings\Administrator\My Documents\Visual
Studio\WebSites\XMLTest\Default.aspx.cs 23 9 C:\...\XMLTest\


protected void Page_Load(object sender, EventArgs e)

{

XmlDocument doc = new XmlDocument();

doc.Load(Server.MapPath("people.xml"));

XslTransform trans = new XslTransform();

trans.Load(Server.MapPath("peopletable.xsl"));

xml1.Document = doc;

xml1.Transform = trans;

}

Author
6 Jan 2006 3:25 PM
S. Justin Gengo
Lasse,

The warnings you have received mean that those classes which existed in .NET
1.1 are no longer being used in .NET 2.0. They are easy to fix simply
replace the classes in question with the classes the warning tells you to
use instead.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
                            Nietzsche
Show quoteHide quote
"Lasse Edsvik" <lasse@nospam.com> wrote in message
news:ep6AdQa8FHA.2716@TK2MSFTNGP11.phx.gbl...
> Hello
>
> I was trying to do this example shown here:
>
> http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/ctrlref/webctrl/Xml/Xml2.src&file=CS\Xml2.aspx&font=3
>
> When I run it I get 3 warnings and nothing shows in the browser, what
> might
> be wrong?
>
> Warning 1 'System.Xml.Xsl.XslTransform' is obsolete: 'This class has been
> deprecated. Please use System.Xml.Xsl.XslCompiledTransform instead.
> http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and
> Settings\Administrator\My Documents\Visual
> Studio\WebSites\XMLTest\Default.aspx.cs 20 9 C:\...\XMLTest\
>
>
> Warning 2 'System.Xml.Xsl.XslTransform' is obsolete: 'This class has been
> deprecated. Please use System.Xml.Xsl.XslCompiledTransform instead.
> http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and
> Settings\Administrator\My Documents\Visual
> Studio\WebSites\XMLTest\Default.aspx.cs 20 34 C:\...\XMLTest\
>
>
> Warning 3 'System.Web.UI.WebControls.Xml.Document' is obsolete: 'The
> recommended alternative is the XPathNavigator property. Create a
> System.Xml.XPath.XPathDocument and call CreateNavigator() to create an
> XPathNavigator. http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents
> and Settings\Administrator\My Documents\Visual
> Studio\WebSites\XMLTest\Default.aspx.cs 23 9 C:\...\XMLTest\
>
>
> protected void Page_Load(object sender, EventArgs e)
>
> {
>
> XmlDocument doc = new XmlDocument();
>
> doc.Load(Server.MapPath("people.xml"));
>
> XslTransform trans = new XslTransform();
>
> trans.Load(Server.MapPath("peopletable.xsl"));
>
> xml1.Document = doc;
>
> xml1.Transform = trans;
>
> }
>
>

Bookmark and Share