XML and XmlDataSource Controlhttp://forums.asp.net/43.aspx/1?XML+and+XmlDataSource+ControlAll about XML, XSLT, and the XmlDataSource control.Thu, 02 May 2013 15:53:24 -0400urn:uuid:00000000-0000-0000-0000-000000000043urn:uuid:00000000-0000-0000-0000-000005402202http://forums.asp.net/p/1908795/5402202.aspx/1?Object+Reference+error+with+Empty+XML+Object Reference error with "Empty" XML <p>While reading an XML file from an&nbsp;Abobe Form submission in an VB.Net application:<br> <br> An empty tag<br> <span class="m">&lt;</span><span class="t">PRType</span> <span class="m">/&gt;<br> </span><br> As opposed to filled tag<br> <span class="m">&lt;</span><span class="t">PRType</span><span class="m">&gt;1<span class="m">&lt;/</span><span class="t">PRType</span> <span class="m">/&gt;</span> </span></p> <p>Throws an &quot;Object Reference not set to an object instance&quot;. When&nbsp;there is data, the process works.</p> <p>I've tried capturing the value of the tag, as in the following but I am unable to understand what, if any value there is when its empty and or how to check it.<br> <br> Its not possible for&nbsp;a user to enter ALL fields on the form... there must be a way to handle &quot;empty&quot;?</p> <p>Assistance would be appreciated... Thanks!!<br> <span size="2" style="font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><br> If</span></span><span size="2" style="font-size:small"> root.SelectSingleNode(</span><span size="2" color="#a31515" style="color:#a31515; font-size:small"><span size="2" color="#a31515" style="color:#a31515; font-size:small">&quot;PRType&quot;</span></span><span size="2" style="font-size:small">).ChildNodes(0).Value = </span><span size="2" color="#a31515" style="color:#a31515; font-size:small"><span size="2" color="#a31515" style="color:#a31515; font-size:small">&quot;&quot;</span></span><span size="2" style="font-size:small"> </span><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small">Then</span></span></span><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"></span></span><span size="2" style="font-size:small"><span size="2" style="font-size:small"><span size="2" style="font-size:small"></span></span></span></p> <p>Response.Write(<span size="2" style="font-size:small"><span size="2" color="#a31515" style="color:#a31515; font-size:small"><span size="2" color="#a31515" style="color:#a31515; font-size:small">&quot;This field is EMPTY&quot;</span></span><span size="2" style="font-size:small">)<br> </span></span>Response.End()<br> <span size="2" style="font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small">End</span></span><span size="2" style="font-size:small"> </span><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small">If</span></span></span><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"></span></span></p> 2013-05-22T12:30:16-04:002013-05-22T12:30:16.987-04:00urn:uuid:00000000-0000-0000-0000-000005399300http://forums.asp.net/p/1908116/5399300.aspx/1?JSON+NET+create+an+array+JSON.NET create an array? <p>Hi Im working JSON.net and need help formating form values to write as below</p> <p>&quot;bw_numbers&quot;: [23, 27, 28, 29, 34, 39],</p> <p>Im thinking i need to create an array from form values, bw_1 bw_2 bw_3 bw_4 bw_5 bw_6 and parse as bw_numbers</p> <p>I have my class set up;</p> <pre class="prettyprint">BW_Results results = new BW_Results { // };</pre> <p><br /><br /></p> <pre class="prettyprint">string json = "jsonCallback(\n" + JsonConvert.SerializeObject(results, Formatting.Indented) + "\n);"; File.WriteAllText(@"C:\inetpub\wwwroot\JSON\dotNet_BW\bw_results.json", json);</pre> <p></p> <p>Just not quuite sure what im doing yet, cheers p</p> 2013-05-20T05:44:23-04:002013-05-20T05:44:23.503-04:00urn:uuid:00000000-0000-0000-0000-000005399801http://forums.asp.net/p/1908228/5399801.aspx/1?Adobe+form+Submission+and+retrieval+in+VB+Net+AppAdobe form Submission and retrieval in VB.Net App <p>I am using the&nbsp;code below to retrieve XML data from an Adobe form submission, but I am unable to post the data to&nbsp;&quot;test.xml&quot;.</p> <p>When I display the URL of the incoming message using:,<br> <span size="2" style="font-size:small">Request.UrlReferrer.AbsolutePath.ToString() <br> <br> I see:<br> URL: C:/Users/jmizrahi/AppData/Local/Temp/_14bs240bp2d3f55pk.pdf</span></p> <p>It is Not an XML file as expected... On the Adobe form I use the &quot;Http&quot; Submit button... I assume that that is a a &quot;POST&quot;. When I tried this using&nbsp;the &quot;EMail&quot; submit button, an xml file was generated and attached to an e-mail, I was able to open and examine the contents fine.</p> <p>Would anyone be able to provide guidance or&nbsp;code examples that illustrate how to send an Adobe form and retrieve the form data?</p> <p>Thanks!!!</p> <p>Protected</p> <p><span size="2" style="font-size:small"></span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">Sub</span></span><span size="2" style="font-size:small"> Page_Load(</span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">ByVal</span></span><span size="2" style="font-size:small"> sender </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">As</span></span><span size="2" style="font-size:small"> </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">Object</span></span><span size="2" style="font-size:small">, </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">ByVal</span></span><span size="2" style="font-size:small"> e </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">As</span></span><span size="2" style="font-size:small"> System.EventArgs) </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">Handles</span></span><span size="2" style="font-size:small"> </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">Me</span></span><span size="2" style="font-size:small">.Load<br> </span><span size="2" style="font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">If</span></span><span size="2" style="font-size:small"> (Request.RequestType = </span><span color="#a31515" size="2" style="color:#a31515; font-size:small"><span color="#a31515" size="2" style="color:#a31515; font-size:small">&quot;POST&quot;</span></span><span size="2" style="font-size:small">) </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">And</span></span><span size="2" style="font-size:small"> (Request.ContentType = </span><span color="#a31515" size="2" style="color:#a31515; font-size:small"><span color="#a31515" size="2" style="color:#a31515; font-size:small">&quot;application/xml; charset=utf-8&quot;</span></span><span size="2" style="font-size:small">) </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">Then<br> </span></span></span><span size="2" style="font-size:small"><span color="#008000" size="2" style="color:#008000; font-size:small"><span color="#008000" size="2" style="color:#008000; font-size:small">'load the posted xml file into the xmldocument object<br> </span></span></span><span size="2" style="font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">Dim</span></span><span size="2" style="font-size:small"> xdoc </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">As</span></span><span size="2" style="font-size:small"> System.Xml.XmlDocument = </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">New</span></span><span size="2" style="font-size:small"> System.Xml.XmlDocument()<br> </span></span>xdoc.Load(Request.InputStream)<br> <span size="2" style="font-size:small"><span color="#008000" size="2" style="color:#008000; font-size:small"><span color="#008000" size="2" style="color:#008000; font-size:small">'save the xml file<br> </span></span></span>xdoc.Save(Server.MapPath(<span size="2" style="font-size:small"><span color="#a31515" size="2" style="color:#a31515; font-size:small"><span color="#a31515" size="2" style="color:#a31515; font-size:small">&quot;c:/inetpub/wwwroot/test.xml&quot;</span></span><span size="2" style="font-size:small">))<br> <br> </span></span><span size="2" style="font-size:small"><span color="#008000" size="2" style="color:#008000; font-size:small"><span color="#008000" size="2" style="color:#008000; font-size:small">'load the xml file from the server and use it<br> </span></span></span>xdoc.Load(Server.MapPath(<span size="2" style="font-size:small"><span color="#a31515" size="2" style="color:#a31515; font-size:small"><span color="#a31515" size="2" style="color:#a31515; font-size:small">&quot;c:/inetpub/wwwroot/test.xml&quot;</span></span><span size="2" style="font-size:small">))<br> <br> </span></span><span size="2" style="font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">End</span></span><span size="2" style="font-size:small"> </span><span color="#0000ff" size="2" style="color:#0000ff; font-size:small"><span color="#0000ff" size="2" style="color:#0000ff; font-size:small">If</span></span></span></p> 2013-05-20T13:18:42-04:002013-05-20T13:18:42.163-04:00urn:uuid:00000000-0000-0000-0000-000005399417http://forums.asp.net/p/1908143/5399417.aspx/1?create+xml+file+from+excel+using+C+netcreate xml file from excel using C#.net <p>create xml file from excel file using C#.net</p> <p><strong>Excel input:</strong></p> <pre class="prettyprint">Allproduct|Cat1|SubCat1|prod1 Allproduct|Cat1|SubCat1|prod2 Allproduct|Cat1|SubCat2|prod3 Allproduct|Cat1|SubCat1|prod4 Allproduct|Cat2|SubCat1|prod1 Allproduct|Cat2|SubCat1|prod2 Allproduct|Cat2|SubCat2|prod3 Allproduct|Cat2|SubCat1|prod4</pre> <pre class="prettyprint"><span style="text-decoration: underline;"><strong>Desire XML Out put:</strong></span></pre> <pre class="prettyprint">&lt;node Text="Allproduct"&gt; &lt;node text="Cat1"&gt; &lt;node text="subcat1&gt; &lt;node text="prod1"/&gt; &lt;node text="prod2"/&gt; &lt;node text="prod4"/&gt; &lt;/node&gt; &lt;node text="subcat2&gt; &lt;node text="prod3"/&gt; &lt;/node&gt; &lt;/node&gt; &lt;node text="Cat2"&gt; &lt;node text="subcat1&gt; &lt;node text="prod1"/&gt; &lt;node text="prod2"/&gt; &lt;node text="prod4"/&gt; &lt;/node&gt; &lt;node text="subcat2&gt; &lt;node text="prod3"/&gt; &lt;/node&gt; &lt;/node&gt; &lt;/node&gt;</pre> <p></p> 2013-05-20T07:32:29-04:002013-05-20T07:32:29.177-04:00urn:uuid:00000000-0000-0000-0000-000005397024http://forums.asp.net/p/1906763/5397024.aspx/1?Formatting+Excel+xlsx+columns+to+number+with+XSL+Stylesheet+Formatting Excel (xlsx) columns to number with XSL Stylesheet. <p>Hi Folks,</p> <p>i have got a Ext.Net Web Application with an Excel (xlsx)export functionality, and would like to format some colums eg. A1 C1 H1 as a&nbsp;<strong>number,&nbsp;</strong>because all columns are represanted as strings.</p> <p>here is my xsl-template:</p> <pre class="prettyprint">&lt;xsl:template match=&quot;/*&quot;&gt; &lt;Worksheet&gt; &lt;xsl:attribute name=&quot;ss:Name&quot;&gt; &lt;xsl:value-of select=&quot;local-name(/*/*)&quot; /&gt; &lt;/xsl:attribute&gt; &lt;Table x:FullColumns=&quot;1&quot; x:FullRows=&quot;1&quot;&gt; &lt;Row&gt; &lt;xsl:for-each select=&quot;*[position() = 1]/*&quot;&gt; &lt;Cell&gt; &lt;Data ss:Type=&quot;String&quot;&gt; &lt;xsl:value-of select=&quot;local-name()&quot; /&gt; &lt;/Data&gt; &lt;/Cell&gt; &lt;/xsl:for-each&gt; &lt;/Row&gt; &lt;xsl:apply-templates/&gt; &lt;/Table&gt; &lt;/Worksheet&gt; &lt;/xsl:template&gt;</pre> <p>thanx for your help</p> <p>Andreas</p> <p></p> 2013-05-17T12:50:56-04:002013-05-17T12:50:56.393-04:00urn:uuid:00000000-0000-0000-0000-000005396083http://forums.asp.net/p/1906533/5396083.aspx/1?Using+value+method+with+sql+variable+in+XQueryUsing value method with sql:variable in XQuery <p>Consider the following element name and XML. I would like to get the value contained within the specified element:</p> <pre class="prettyprint">declare @Element varchar(20) = 'Age' declare @RequestXML xml set @RequestXML = '&lt;Root&gt; &lt;UserDefined&gt; &lt;Age&gt;21&lt;/Age&gt; &lt;MinDOB&gt;01 Jan 1965&lt;/MinDOB&gt; &lt;MaxDOB&gt;01 Jan 1995&lt;/MaxDOB&gt; &lt;EyeColour&gt;Blue&lt;/EyeColour&gt; &lt;/UserDefined&gt; &lt;/Root&gt;'</pre> <p></p> <p>The following retrieves the required value, however "Age" has been hard-coded here:</p> <pre class="prettyprint">select @RequestXML.value('(//Age)[1]', 'varchar(20)')</pre> <p></p> <p>Instead, I want the element to be defined <em>dynamically</em> using sql:variable("@Element"). However, the following results in an error:</p> <pre class="prettyprint">select @RequestXML.value('//sql:variable("@Element"))', 'varchar(20)')</pre> <p>Msg 2370, Level 16, State 1, Line 16<br> XQuery [value()]: No more tokens expected at the end of the XQuery expression. Found ')'.<br> <br> <br> Can anyone please suggest a working solution?</p> 2013-05-16T15:16:57-04:002013-05-16T15:16:57.967-04:00urn:uuid:00000000-0000-0000-0000-000005395865http://forums.asp.net/p/1906474/5395865.aspx/1?json+net+formating+datajson.net formating data <p>Hi I need some help with Posting Data to JSON file. I have set up json.net and am parsing form values like so;</p> <pre class="prettyprint">Account account = new Account { Name = Request[&quot;Name&quot;], Email = Request[&quot;Email&quot;], Message = Request[&quot;Message&quot;], }; string json = JsonConvert.SerializeObject(account, Formatting.Indented); File.WriteAllText(@&quot;C:\inetpub\wwwroot\JSON\dotNet5\test_file.json&quot;, json);</pre> <p>This outputs JSON ok!</p> <pre class="prettyprint">{ "Name": "ghghg", "Email": "hghg@ggfgdf.com", "Message": "hghgh" }</pre> <p>What I need is the JSON to be written as below, adding jsonCallback( );</p> <pre class="prettyprint">jsonCallback( { "Name": "ghghg", "Email": "hghg@ggfgdf.com", "Message": "hghgh" } );</pre> <p><br> <br> </p> <p></p> <p>Ive not used json.net before so all help greatly appreciated, cheers P</p> 2013-05-16T11:42:47-04:002013-05-16T11:42:47.94-04:00urn:uuid:00000000-0000-0000-0000-000005391110http://forums.asp.net/p/1905349/5391110.aspx/1?Deny+XML+for+users+but+not+client+sideDeny XML for users but not client-side <p>Is it possible to deny a user to opent an xml file, but still let the user side be able to access the file through js/ajax?</p> <p>I am making a multiplayer game and want xml to hold the data, but I dont want anyone accessing the file by knowing its url.</p> 2013-05-11T13:15:38-04:002013-05-11T13:15:38.383-04:00urn:uuid:00000000-0000-0000-0000-000005393235http://forums.asp.net/p/1905870/5393235.aspx/1?Constructing+Evaluating+and+Storing+Rules+Using+XML+and+T+SQLConstructing, Evaluating and Storing Rules Using XML and T-SQL <p>Are there any existing examples or references out there of how one might be able to construct something to achieve the above? I would ideally like to write something where:</p> <ul> <li>Data is supplied in XML format </li><li>Decisioning is highly configurable </li><li>One does not have to re-write SQL code to cater for new rules </li><li>Rules are evaluated in SQL only </li></ul> <p>The following link is an interesting read, however this is C# based: <a href="http://moustafarefaat.com/moustafapws/extxmlre.aspx"> http://moustafarefaat.com/moustafapws/extxmlre.aspx</a></p> <p>Are there any existing XML-based rule operators out there? Any pointers would be greatly appreciated!</p> 2013-05-14T09:07:37-04:002013-05-14T09:07:37.977-04:00urn:uuid:00000000-0000-0000-0000-000005385484http://forums.asp.net/p/1904086/5385484.aspx/1?xml+and+dtdxml and dtd <p>hello to every one</p> <p>i m working on xml dtd ..can any one told me</p> <ol> <li>how to skip following line </li></ol> &lt;div style=&quot;text-indent: -2em; margin-left: 1em;&quot; class=&quot;c&quot;&gt;<strong><a class="b" href="file:///C:/Documents%20and%20Settings/erum.mirza/Desktop/premium-world-check_OFAC_USA.xml#">-</a> <span class="m">&lt;my</span><span class="t">records</span><span class="ns"> xmlns:xsi</span><span class="m">=&quot;</span>http://www.w3.org/2001/XMLSchema-instance<span class="m">&quot;</span><span class="t"> xsi:noNamespaceSchemaLocation</span><span class="m">=&quot;my</span>check.xsd<span class="m">&quot;</span><span class="m">&gt;</span></strong>&lt;/div&gt; <p>and implment dtd rather than xsd (fro validation of xml)&nbsp; ..I made dtd which is some how working</p> <p>2- apart from that i need to apppend dtd reference (&lt;!DOCTYPE&nbsp; record SYSTEM my.dtd&quot;&gt;)in my xml file ... ..</p> <p>Pleaase help me ..do let me know when further&nbsp; expalantion is required..</p> <p>&nbsp;</p> <p>Thanks</p> <p>&nbsp;</p> 2013-05-06T11:39:21-04:002013-05-06T11:39:21.983-04:00urn:uuid:00000000-0000-0000-0000-000005390494http://forums.asp.net/p/1905226/5390494.aspx/1?XML+Read+File+ErrorXML Read File Error <p>Hi,</p> <p>I&nbsp;have the following code,</p> <pre class="prettyprint">Dim xmldoc As New XmlDocument() xmldoc.Load(Server.MapPath(&quot;~\export\LiStatus.xml&quot;)) Dim objNode As XmlNode = node.selectSingleNode(&quot;Identity/Type&quot;) If objNode IsNot Nothing Then If objNode.Value.ToString() = &quot;500&quot; Then ' ElseIf objNode.Value.ToString() = &quot;501&quot; Then ' End If End If</pre> <p>I get an error on 'node' on the following line:</p> <p>Dim objNode As XmlNode = node.selectSingleNode(&quot;Identity/Type&quot;)</p> <p>Any help appreciated.</p> 2013-05-10T15:47:40-04:002013-05-10T15:47:40.7-04:00urn:uuid:00000000-0000-0000-0000-000005390644http://forums.asp.net/p/1905255/5390644.aspx/1?How+to+store+Excel+file+as+XML+and+pass+this+XML+to+stored+procedure+How to store Excel file as XML and pass this XML to stored procedure? <p>I want to read an Excel file and store the result as XML to a DataSet. I want to pass this XML data to stored procedure as a parameter.</p> 2013-05-10T18:26:59-04:002013-05-10T18:26:59.49-04:00urn:uuid:00000000-0000-0000-0000-000005288113http://forums.asp.net/p/1879354/5288113.aspx/1?How+to+Write+XSL+with+Rowspan+and+bgcolorHow to Write XSL with Rowspan and bgcolor <p>Hi</p> <p>I need to create HTML file with a Table from XML file.</p> <p>Table has 6 rows (Row&nbsp; 1 rowspan is 3, Row 4 rowspan is 3).</p> <p>How to write xsl(v 1.0) to display first 3 rows bgcolor as gray &amp; next 3 rows bgcolor as yellow then next 3 rows bgcolor as gray(if i've more).</p> <p>If the first Row rowspan is 4, first 4 rows bgcolor as gray next four rows bgcolor as yellow.</p> <p>Please advice</p> 2013-01-31T14:44:38-05:002013-01-31T14:44:38.34-05:00urn:uuid:00000000-0000-0000-0000-000005382740http://forums.asp.net/p/1903403/5382740.aspx/1?Linq+to+XML+IssueLinq to XML Issue <p>I am passing an XML document to my stored procedure. Is there a way I can pass in the declaration as well? Right now I do a Stringbuilder and append the declaration first and then do a xmldoc.ToString() to pass in the whole thing. Is there a way to do just xmldoc.ToString() where it will know to include the declaration?</p> 2013-05-03T00:21:06-04:002013-05-03T00:21:06.197-04:00urn:uuid:00000000-0000-0000-0000-000005389476http://forums.asp.net/p/1905008/5389476.aspx/1?Linq+to+xml+not+working+Linq to xml not working <pre class="prettyprint">&lt;TravelItineraryReadRS TimeStamp=&quot;2013-05-09T17:55:46&quot; Version=&quot;1.1.1&quot;&gt; &lt;Success/&gt; &lt;TravelItinerary&gt; &lt;PersonName NameNumber=&quot;01.01&quot; NameReference=&quot;SCM0978-NA021215&quot; RPH=&quot;1&quot;&gt; &lt;GivenName&gt;RESERVATION&lt;/GivenName&gt;&lt;Surname&gt;TEST&lt;/Surname&gt; &lt;Email&gt;test@test.COM?&lt;/Email&gt;&lt;/PersonName&gt; &lt;Telephone AreaCityCode=&quot;BDL&quot; PhoneNumber=&quot;7/732-555-0400&quot; RPH=&quot;001&quot;/&gt; &lt;Telephone AreaCityCode=&quot;BDL&quot; PhoneNumber=&quot;201-555-1350-B&quot; RPH=&quot;002&quot;/&gt;&lt;Telephone AreaCityCode=&quot;BDL&quot; PhoneNumber=&quot;201-555-4938-F&quot; RPH=&quot;003&quot;/&gt; &lt;Telephone AreaCityCode=&quot;BDL&quot; PhoneNumber=&quot;908-555-6400-C&quot; RPH=&quot;004&quot;/&gt;&lt;Telephone AreaCityCode=&quot;BDL&quot; PhoneNumber=&quot;732-555-0872-H&quot; RPH=&quot;005&quot;/&gt; &lt;ItineraryInfo&gt;&lt;ReservationItems&gt;&lt;Item RPH=&quot;1&quot;&gt; &lt;FlightSegment ArrivalDateTime=&quot;07-28T11:00:00&quot; DepartureDateTime=&quot;2013-07-28T09:00:00&quot; FlightNumber=&quot;0491&quot; NumberInParty=&quot;01&quot; ResBookDesigCode=&quot;Q&quot; SegmentNumber=&quot;0001&quot; Status=&quot;YK&quot;&gt; &lt;OriginLocation LocationCode=&quot;EWR&quot;/&gt;&lt;DestinationLocation LocationCode=&quot;DTW&quot;/&gt;&lt;MarketingAirline Code=&quot;CO&quot; FlightNumber=&quot;0491&quot;/&gt; &lt;UpdatedDepartureTime&gt;07-28T09:00:00&lt;/UpdatedDepartureTime&gt;&lt;UpdatedArrivalTime&gt;07-28T11:00:00&lt;/UpdatedArrivalTime&gt;&lt;/FlightSegment&gt; &lt;/Item&gt;&lt;Item RPH=&quot;2&quot;&gt;&lt;FlightSegment ArrivalDateTime=&quot;08-05T20:49:00&quot; DepartureDateTime=&quot;2013-08-05T18:55:00&quot; FlightNumber=&quot;0482&quot; NumberInParty=&quot;01&quot; ResBookDesigCode=&quot;Q&quot; SegmentNumber=&quot;0003&quot; Status=&quot;YK&quot;&gt;&lt;OriginLocation LocationCode=&quot;DTW&quot;/&gt;&lt;DestinationLocation LocationCode=&quot;EWR&quot;/&gt; &lt;MarketingAirline Code=&quot;CO&quot; FlightNumber=&quot;0482&quot;/&gt; &lt;UpdatedDepartureTime&gt;08-05T18:55:00&lt;/UpdatedDepartureTime&gt; &lt;UpdatedArrivalTime&gt;08-05T20:49:00&lt;/UpdatedArrivalTime&gt;&lt;/FlightSegment&gt; &lt;/Item&gt;&lt;Item RPH=&quot;3&quot;&gt; &lt;Hotel SegmentNumber=&quot;0002&quot; Status=&quot;GK&quot; Type=&quot;HHT&quot;&gt; &lt;SpecialPrefs&gt;&lt;Text&gt;CF&lt;/Text&gt;&lt;/SpecialPrefs&gt; &lt;RoomType RoomTypeCode=&quot;C2Q&quot;/&gt;&lt;RoomRate&gt;&lt;Base Amount=&quot;69.00&quot;/&gt; &lt;/RoomRate&gt;&lt;GuestCounts&gt;&lt;GuestCount Count=&quot;01&quot;/&gt; &lt;/GuestCounts&gt;&lt;TimeSpan End=&quot;08-05&quot; Start=&quot;07-28&quot;/&gt; &lt;BasicPropertyInfo ChainCode=&quot;AA&quot; HotelCityCode=&quot;DTW&quot; HotelName=&quot;MARIOTT&quot;/&gt; &lt;Address&gt;&lt;AddressLine&gt;201 WESTFIELD&lt;/AddressLine&gt; &lt;AddressLine&gt;DETROIT MI 30293&lt;/AddressLine&gt;&lt;/Address&gt; &lt;ContactNumbers&gt;&lt;ContactNumber PhoneNumber=&quot;717-235-3333&quot;/&gt; &lt;/ContactNumbers&gt;&lt;/Hotel&gt; &lt;/Item&gt;&lt;/ReservationItems&gt; &lt;Ticketing RPH=&quot;01&quot; TicketTimeLimit=&quot;T-&quot;/&gt;&lt;/ItineraryInfo&gt; &lt;/TravelItinerary&gt;&lt;/TravelItineraryReadRS&gt;</pre> <p></p> <p>I am looking for AddressLine from Address and try to write query but it is not working.</p> <p></p> <pre class="prettyprint"> XDocument xdoc = XDocument.Load("hotelitinerary.xml"); var hotels = xdoc.Descendants("Hotel"); </pre> <p><br> <br> </p> 2013-05-09T18:30:34-04:002013-05-09T18:30:34.33-04:00urn:uuid:00000000-0000-0000-0000-000005389130http://forums.asp.net/p/1904921/5389130.aspx/1?Extracting+escaped+XML+from+encapsulated+responseExtracting escaped XML from encapsulated response <p>We have a web service that returns encapsulated XML to a T-SQL stored procedure in the following format:</p> <p>&lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;<br> &nbsp; &lt;soap:Body&gt;<br> &nbsp;&nbsp;&nbsp; &lt;GetAddressResponse xmlns=&quot;http://tempuri.com/myWS/&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GetAddressResult&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&amp;lt;myWSCode&amp;gt;&amp;lt;Result&amp;gt;AddressOK&amp;lt;/Result&amp;gt;&amp;lt;/myWSCode&amp;gt;&lt;/GetAddressResult&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/GetAddressResponse&gt;<br> &nbsp; &lt;/soap:Body&gt;<br> &lt;/soap:Envelope&gt;</p> <p>I essentially want to select the following as an XML column:</p> <p>&lt;myWSCode&gt;<br> &nbsp;&nbsp; &nbsp;&lt;Result&gt;AddressOK&lt;/Result&gt;<br> &lt;/myWSCode&gt;</p> <p>The following link has got me most of the way there - <a href="http://stackoverflow.com/questions/4927300/sql-and-escaped-xml-data:"> http://stackoverflow.com/questions/4927300/sql-and-escaped-xml-data</a></p> <pre class="prettyprint">select convert(xml, n.c.value('.', 'varchar(max)')) from @xml.nodes('soap:Envelope/soap:Body/GetAddressResponse/GetAddressResult/text()') n(c)</pre> <p>However, this obviously does not process the namespace references correctly and results in the following error:</p> <p>Msg 2229, Level 16, State 1, Line 38<br> XQuery [nodes()]: The name &quot;soap&quot; does not denote a namespace.<br> </p> <p></p> 2013-05-09T11:44:36-04:002013-05-09T11:44:36.943-04:00urn:uuid:00000000-0000-0000-0000-000005388328http://forums.asp.net/p/1904731/5388328.aspx/1?xml+file+not+showing+in+xmldatasourcexml file not showing in xmldatasource <p>I am creating my first app in asp.net.</p> <p>I am trying to decide on which grid control to use and need to link a grid control to an xml file as a datasource.&nbsp; I put the xml file in the project folder.&nbsp;Using the wizard to bind the datasource, I select the 'Browse' button for&nbsp;the data file.&nbsp; I get the dialog box, Select XML File.&nbsp; On the left is the tree of my project.&nbsp; I have put the xml file in a couple of the folders and when I select the folder, the xml file does not appear.&nbsp; When I select 'all files', I can see the Default.aspx and Web.config file in the top folder.</p> <p>How can I get&nbsp;the xml file to appear?</p> <p>Thanks in advance.</p> <p>Gloria</p> <p>&nbsp;</p> 2013-05-08T16:15:22-04:002013-05-08T16:15:22.52-04:00urn:uuid:00000000-0000-0000-0000-000005386687http://forums.asp.net/p/1904332/5386687.aspx/1?Google+Base+XML+Consumption+C+RazorGoogle Base XML Consumption C# & Razor <p>Hi All,</p> <p>I'm trying to consume an xml feed based on the Google Base namespace. I keep getting an error regarding the g: on nodes.</p> <p>Heres an example of the document:</p> <pre class="prettyprint">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;feed xmlns=&quot;http://www.w3.org/2005/Atom&quot; xmlns:g=&quot;http://base.google.com/ns/1.0&quot; xmlns:c=&quot;http://base.google.com/cns/1.0&quot;&gt; &lt;title&gt;Feed Title&lt;/title&gt; &lt;link rel=&quot;self&quot; href=&quot;http://www.mydomain.local&quot;/&gt; &lt;author&gt; &lt;name&gt;My Google Base Feed&lt;/name&gt; &lt;/author&gt; &lt;id&gt;tag:mydomain.local,2013-05-05&lt;/id&gt; &lt;updated&gt;2013-05-05T11:50:54Z&lt;/updated&gt;</pre> <pre class="prettyprint"> &lt;entry&gt; &lt;title&gt;First Items Title&lt;/title&gt; &lt;summary&gt;&lt;![CDATA[Text summary of item lisitng]]&gt;&lt;/summary&gt; &lt;id&gt;ITD123&lt;/id&gt; &lt;g:image_link&gt;exterior.jpg&lt;/g:image_link&gt; &lt;g:image_link&gt;lounge.JPG&lt;/g:image_link&gt; &lt;g:image_link&gt;kitchen.JPG&lt;/g:image_link&gt; &lt;g:image_link&gt;bed1.JPG&lt;/g:image_link&gt; &lt;link href="http://mydomain.local/" /&gt; &lt;g:location&gt;London&lt;/g:location&gt; &lt;g:make&gt;Ford&lt;/g:make&gt; &lt;g:model&gt;Focus&lt;/g:model&gt; &lt;g:price&gt;4995&lt;/g:price&gt; &lt;g:year&gt;2012&lt;/g:year&gt; &lt;g:bedrooms&gt;2&lt;/g:bedrooms&gt; &lt;c:type type="string"&gt;Hatchback&lt;/c:type&gt; &lt;g:condition&gt;Second Hand&lt;/g:condition&gt; &lt;c:width&gt;6'&lt;/c:width&gt; &lt;c:length&gt;16'&lt;/c:length&gt; &lt;c:age&gt;&lt;/c:age&gt; &lt;c:condition&gt;Excellent&lt;/c:condition&gt; &lt;c:exdisplay&gt;False&lt;/c:exdisplay&gt; &lt;c:regionName&gt;&lt;![CDATA[London]]&gt;&lt;/c:regionName&gt; &lt;c:Postcode&gt;EC1V&lt;/c:Postcode&gt; &lt;/entry&gt;</pre> <p><br> Can any one suggest the best tool to get this data out? (So that I can store it in a SQL Db).</p> <p>Thanks for any help :)</p> <p>Jus</p> 2013-05-07T09:55:04-04:002013-05-07T09:55:04.643-04:00urn:uuid:00000000-0000-0000-0000-000005385478http://forums.asp.net/p/1904083/5385478.aspx/1?Parsing+Json+FileParsing Json File <p>hi,</p> <p>I have a json file something similar to below.</p> <p>{<br> &quot;Users&quot;: [<br> {<br> &quot;UID&quot;: &quot;judyh&quot;,<br> &quot;UUID&quot;: &quot;UUID_001&quot;,<br> &quot;Ustatus&quot;: &quot;A&quot;,<br> &quot;Lname&quot;: &quot;HIGGS&quot;,<br> &quot;NS&quot;: &quot;16&quot;,<br> &quot;Email&quot;: &quot;judy.higgs@factiva.com&quot;,<br> &quot;Account&quot;: &quot;9ZZZ002000&quot;,<br> &quot;Fname&quot;: &quot;JUDY&quot;,<br> &quot;AccCode&quot;: &quot;0001&quot;<br> },<br> {<br> &quot;UID&quot;: &quot;judyh&quot;,<br> &quot;UUID&quot;: &quot;UUID_002&quot;,<br> &quot;Ustatus&quot;: &quot;A&quot;,<br> &quot;Lname&quot;: &quot;HIGGS&quot;,<br> &quot;NS&quot;: &quot;16&quot;,<br> &quot;Email&quot;: &quot;judy.higgs@factiva.com&quot;,<br> &quot;Account&quot;: &quot;9ZZZ002000&quot;,<br> &quot;Fname&quot;: &quot;JUDY&quot;,<br> &quot;AccCode&quot;: &quot;0001&quot;<br> },<br> ],<br> &quot;Action&quot;: &quot;c&quot;<br> }</p> <p></p> <p>I want to remove curly braces and get the data starting from SQuare brackets.</p> <p>ALso i want to read &quot;Action&quot; which is &quot;C&quot; in this case but it may differ</p> 2013-05-06T11:33:27-04:002013-05-06T11:33:27.29-04:00urn:uuid:00000000-0000-0000-0000-000005379370http://forums.asp.net/p/1902661/5379370.aspx/1?Create+XML+file+from+existing+DTD+fileCreate XML file from existing DTD file <p>I have a DTD file with some rules. Now i have to create an xml file based on this schema in VS 2012</p> 2013-04-30T05:41:50-04:002013-04-30T05:41:50.73-04:00