Last post Feb 18, 2011 12:08 AM by IMBack
Feb 17, 2011 07:14 PM|IMBack|LINK
I have a string xml:
Feb 17, 2011 07:32 PM|RaviSM|LINK
Hi How are u? Hope doing fine.
<asp:Repeater ID="Repeater" runat="server" DataSourceID="XmlDataSource">
<asp:XmlDataSource ID="XmlDataSource" DataFile="~/Test.xml" runat="server" XPath="/Result">
Feb 17, 2011 10:18 PM|IMBack|LINK
HI Ravi, I m surving :)) I hope you doing well... thanks for your reply, I was wondering do you know how to get the Approved attribute via source code/code-behind. I need to add some business rules before showing it in the UI, Thanks again
Feb 17, 2011 10:39 PM|RaviSM|LINK
I am also doing fine here is the solution btw what's you name?
XmlDocument xmlDoc = XmlDataSource.GetXmlDocument();
Feb 17, 2011 11:05 PM|IMBack|LINK
I think the code would work if I was pulling from some datasource, my source is the string that contains xml ... My name is Stan, where you from?
Feb 17, 2011 11:10 PM|RaviSM|LINK
Yep in this particular example i have assign a xml file as given by you. and it definetly work.
I am from INDIA and wht abt you?
Feb 17, 2011 11:35 PM|IMBack|LINK
HI Ravi, I am a bit confued, how do you assign the xml sting, not a file. lets say my xml string is
string xml=" <?xml version='1.0'?><Result><Approved>FAILED</Approved></Result>";
I want to print approved value......I am from Canada :) Thanks
Feb 17, 2011 11:54 PM|RaviSM|LINK
Hi try with this I hope this works fine
string myxml = (@"<?xml version='1.0' encoding='UTF-8' ?>
<TransTime>Thu Feb 17 19:10:22 EST 2011</TransTime>
XmlDocument xmlDoc = new XmlDocument();
Feb 18, 2011 12:08 AM|IMBack|LINK
AWESOME! works! Thanks Ravi, How did you know to put the @ symbol before the xml string? Share where you learn those tricks?:):):)