You are currently viewing the BOOK: Professional ASP.NET 2.0 XML section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
saves the Stocks.xml file in the following format:
<Stocks>
<name>INTC</name>
<price>96</price>
</Stocks>
while the file supplied is of this format
<Stocks name="INTC" price="96" />
Now if you create the XML File from the application; this line will not work
<asp:XmlDataSource runat="server" DataFile="~/App_Data/Stocks.xml" ID="XmlDataSource1" XPath="Stocks" /> You need to change the property XPath="Stocks" to XPath="price".
You have to create a xslt file to transform the xml file, remove the XPath property and add TransformFile="~/Stocks.xslt" in the GridView control. The Stocks.xslt file is as follows: