<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>XML and XmlDataSource Control</title><link>http://forums.asp.net/43.aspx</link><description>All about XML, XSLT, and the XmlDataSource control.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Error: Looping through an xml twice instead on of once.</title><link>http://forums.asp.net/thread/3276065.aspx</link><pubDate>Mon, 06 Jul 2009 06:05:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3276065</guid><dc:creator>kavita_khandhadia</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3276065.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=43&amp;PostID=3276065</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;penkye:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;Hi kavita, i&amp;#39;m not at this point trying to input any more data into the xml. i have the data that i need already and need to pass it to a process that will read and input the data into our system. For some strange reason when it loops through the selection node (item) it sort of loops twice and i don&amp;#39;t know why?&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Humm of course i know that,,,&lt;/p&gt;&lt;p&gt;i mean to say That..&lt;/p&gt;&lt;p&gt;whenu do this..&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:x-small;"&gt;xmlDoc.Load(&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;quot;D:\website\apphtml\da_beta\xml\&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; + iCookie + &lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;quot;.xml&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;u can get the xml input file by doing this&lt;/p&gt;&lt;p&gt;&lt;b&gt;string myXml = &lt;span style="font-size:x-small;"&gt;xmlDoc.DocumentElement.OuterXml.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:x-small;"&gt;I wanted u to paste the &lt;/span&gt;myXml varibale result over here.. it wud be good if u do that..so that we can solve ur prob&lt;/p&gt;&lt;p&gt;&amp;nbsp;:)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: Error: Looping through an xml twice instead on of once.</title><link>http://forums.asp.net/thread/3273709.aspx</link><pubDate>Fri, 03 Jul 2009 14:49:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273709</guid><dc:creator>agr001</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273709.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=43&amp;PostID=3273709</wfw:commentRss><description>&lt;p&gt;Remove this line...&amp;nbsp;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;node&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;XmlNode = xmlDoc.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/cart_item/item&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;And change the loop to&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" color="#0000FF" size="3"&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;For&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;Each&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;node as XmlNode&amp;nbsp;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;In&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;m_nodelist&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;this should do the trick. &amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Error: Looping through an xml twice instead on of once.</title><link>http://forums.asp.net/thread/3273688.aspx</link><pubDate>Fri, 03 Jul 2009 14:34:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273688</guid><dc:creator>penkye</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273688.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=43&amp;PostID=3273688</wfw:commentRss><description>&lt;p&gt;Hi kavita, i&amp;#39;m not at this point trying to input any more data into the xml. i have the data that i need already and need to pass it to a process that will read and input the data into our system. For some strange reason when it loops through the selection node (item) it sort of loops twice and i don&amp;#39;t know why?&lt;/p&gt;</description></item><item><title>Re: Error: Looping through an xml twice instead on of once.</title><link>http://forums.asp.net/thread/3273178.aspx</link><pubDate>Fri, 03 Jul 2009 09:33:43 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273178</guid><dc:creator>kavita_khandhadia</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273178.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=43&amp;PostID=3273178</wfw:commentRss><description>&lt;p&gt;Provide 2 things here...ur input xml and wot out put u need from that xml&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Error: Looping through an xml twice instead on of once.</title><link>http://forums.asp.net/thread/3271747.aspx</link><pubDate>Thu, 02 Jul 2009 15:47:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3271747</guid><dc:creator>penkye</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3271747.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=43&amp;PostID=3271747</wfw:commentRss><description>&lt;p&gt;Hi Samu, I tried your suggestion but it some how still loops twice through the xml file. I&amp;#39;m not exactly sure what to do but i do well any suggestions or different approach to my problem.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks.&lt;/p&gt;</description></item><item><title>Re: Error: Looping through an xml twice instead on of once.</title><link>http://forums.asp.net/thread/3174896.aspx</link><pubDate>Wed, 20 May 2009 09:28:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3174896</guid><dc:creator>Samu Zhang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3174896.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=43&amp;PostID=3174896</wfw:commentRss><description>&lt;p&gt;Hi &lt;strong&gt;penkye &lt;/strong&gt;,&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;penkye:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; I don&amp;#39;t seem to understand why it does the whole for loop twice&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;There are two item nodes in this xml file. The xpath (&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/cart_item/item&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;) indicate that to fetch all item nodes under cart_item node. So loop twice.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Error: Looping through an xml twice instead on of once.</title><link>http://forums.asp.net/thread/3163364.aspx</link><pubDate>Thu, 14 May 2009 19:18:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3163364</guid><dc:creator>penkye</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3163364.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=43&amp;PostID=3163364</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I just stampled accross this weired behavior trying to loop through an xml file by selecting the appropriate nodes. I don&amp;#39;t seem to understand why it does the whole for loop twice. Any help greatly appreciated.&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xmlDoc &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XmlDataDocument&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; m_nodelist &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XmlNodeList&lt;/p&gt;xmlDoc.Load(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;D:\website\apphtml\da_beta\xml\&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + iCookie + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;.xml&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;m_nodelist = xmlDoc.SelectNodes(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/cart_item/item&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; node &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XmlNode = xmlDoc.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/cart_item/item&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;For&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Each&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; node &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;In&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; m_nodelist&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;StockCode = node(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;part_no&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).InnerText&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;Response.Write(StockCode)&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Next&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font size="2"&gt;And i get this from the loop:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;N1005176&lt;br /&gt;N1005177&lt;br /&gt;N1005178&lt;br /&gt;N1005179&lt;br /&gt;Sales Order Posting Successfull&lt;br /&gt;Sales Order: 076436N1005176&lt;br /&gt;N1005177&lt;br /&gt;N1005178&lt;br /&gt;N1005179&lt;br /&gt;Sales Order Posting Successfull&lt;br /&gt;Sales Order: 076437 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;xml file:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;cart_item&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;item&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;CustID&amp;gt;734631&amp;lt;/CustID&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;part_no&amp;gt;N1005176&amp;lt;/part_no&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;prod_desc&amp;gt;Mobile Double Drawer&amp;lt;/prod_desc&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Qty&amp;gt;1&amp;lt;/Qty&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;price&amp;gt;$49.92&amp;lt;/price&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;isize&amp;gt;Gray&amp;lt;/isize&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;icolor /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;irecnum&amp;gt;135924&amp;lt;/irecnum&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;date&amp;gt;5/12/2009 2:11:25 PM&amp;lt;/date&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;subtotal&amp;gt;49.92&amp;lt;/subtotal&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/item&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;item&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;CustID&amp;gt;734631&amp;lt;/CustID&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;part_no&amp;gt;N1005177&amp;lt;/part_no&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;prod_desc&amp;gt;Storage Lockers Single Tier&amp;lt;/prod_desc&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Qty&amp;gt;1&amp;lt;/Qty&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;price&amp;gt;$147.14&amp;lt;/price&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;isize&amp;gt;Dove Grey&amp;lt;/isize&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;icolor&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/icolor&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;irecnum&amp;gt;135816&amp;lt;/irecnum&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;date&amp;gt;5/12/2009 2:11:36 PM&amp;lt;/date&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;subtotal&amp;gt;147.14&amp;lt;/subtotal&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/item&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;lt;/item&amp;gt;&lt;br /&gt;&amp;lt;/cart_item&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>