{"id":9791,"date":"2021-12-02T23:55:03","date_gmt":"2021-12-02T23:55:03","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=9791"},"modified":"2021-12-02T23:55:27","modified_gmt":"2021-12-02T23:55:27","slug":"solved-read-attribute-value-from-xml-through-batch-script","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/read-attribute-value-from-xml-through-batch-script\/28327.html","title":{"rendered":"Solved Read Attribute Value From Xml Through Batch Script"},"content":{"rendered":"<p>Suppose,in my testfile.xml i have ,<br \/>\n&lt;head ip=&#8221;123&#8243; \/&gt;<br \/>\nand if i have to fetch the value of ip i.e, 123 through batch scrpiting..<br \/>\ni have tried the code and i am not getting the value 123 in my output<br \/>\nthis is the code i have written in test.bat<br \/>\n@echo on<br \/>\nfor \/F &#8220;usebackq tokens=*&#8221; %%I IN (&#8216;findstr \/l &#8220;head ip=&#8221; C:\\Temp\\testfile.xml&#8217;)<br \/>\ndo call :readxml %%I<br \/>\n:readxml<br \/>\nset var1=%1<br \/>\necho %var1%<\/p>\n<p>I am new to Batch scripting please correct me if I am wrong in the code.<\/p>\n<p>Thanks in Advance<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":3},"question-category":[55],"question_tags":[],"class_list":["post-9791","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/9791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=9791"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=9791"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=9791"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=9791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}