{"id":2316,"date":"2013-05-03T17:56:14","date_gmt":"2013-05-03T08:56:14","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=2316"},"modified":"2014-07-11T18:35:20","modified_gmt":"2014-07-11T09:35:20","slug":"xml-attribute-%ec%b6%94%ea%b0%80","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=2316","title":{"rendered":"xml Element and Attribute \ucd94\uac00 (Creating New Element and Attribute)"},"content":{"rendered":"<p><code><br \/>\nXmlDocument doc = new XmlDocument();<br \/>\ndoc.LoadXml(xmlPSW5);<\/code><\/p>\n<p>XmlNodeList node = doc.GetElementsByTagName(&#8220;ETR_INF&#8221;);<br \/>\nfor (int i = 0; i &lt; node.Count; i++)<br \/>\n{<br \/>\n\/\/attribute \ucd94\uac00<br \/>\nXmlAttribute newAttribute = doc.CreateAttribute(&#8220;LocationName&#8221;);<br \/>\nnewAttribute.Value = ARL_COD_Name;<br \/>\nnode.Item(i).SelectSingleNode(&#8220;ARL_COD&#8221;).Attributes.Append(newAttribute);<\/p>\n<p>\/\/Element \ucd94\uac00 \ubc29\ubc95 1<br \/>\nXmlElement newElement = doc.CreateElement(&#8220;DEP_DAT&#8221;);<br \/>\nXmlText newtext = doc.CreateTextNode(FLI_DAT);<br \/>\nnewElement.AppendChild(newtext);<br \/>\nnode.Item(i).AppendChild(newElement);<\/p>\n<p>\/\/Element \ucd94\uac00 \ubc29\ubc95 2<br \/>\nString sGRAND_TOTAL = &#8220;&lt;GRAND_TOTAL&gt;&lt;GRAND_AMT&gt;&#8221; + GRAND_TOTAL + &#8220;&lt;\/GRAND_AMT&gt;&lt;\/GRAND_TOTAL&gt;&#8221;;<\/p>\n<p>XmlDocumentFragment xfrag = doc.CreateDocumentFragment();<br \/>\nxfrag.InnerXml = sGRAND_TOTAL;<br \/>\n\/\/\uc870\uac74 Append<br \/>\nif (node.Item(i).SelectNodes(&#8220;FAR_INF[FAR_BKD_TYP=&#8217;A&#8217;]&#8221;).Count &gt; 0)<br \/>\n{<br \/>\nnode.Item(i).SelectSingleNode(&#8220;FAR_INF[FAR_BKD_TYP=&#8217;A&#8217;]&#8221;).AppendChild(xfrag);<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ Element \ubcc0\uacbd \ubc29\ubc95<br \/>\n\/\/ Element replace<\/p>\n<p>\/\/Create a new title element.<br \/>\nXmlElement elem = doc.CreateElement(&#8220;COS&#8221;);<br \/>\nelem.InnerText = ResultSeats;<\/p>\n<p>nodelist.Item(i).ReplaceChild(elem, nodelist.Item(i).SelectSingleNode(&#8220;COS&#8221;));<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlPSW5); XmlNodeList node = doc.GetElementsByTagName(&#8220;ETR_INF&#8221;); for (int i = 0; i &lt; node.Count; i++) { \/\/attribute \ucd94\uac00 XmlAttribute newAttribute = <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=2316\" title=\"xml Element and Attribute \ucd94\uac00 (Creating New Element and Attribute)\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-2316","post","type-post","status-publish","format-standard","hentry","category-devc"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2316"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2316\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}