{"id":9837,"date":"2025-08-08T18:05:12","date_gmt":"2025-08-08T09:05:12","guid":{"rendered":"https:\/\/www.auctionpro.co.kr\/?p=9837"},"modified":"2025-08-08T18:05:12","modified_gmt":"2025-08-08T09:05:12","slug":"xmlelement-%ed%8a%b9%ec%84%b1","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=9837","title":{"rendered":"[XmlElement] \ud2b9\uc131"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\ucc28\uc774 <\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">case 1<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >public class Retrieve\n{\n    public Air[] Air { get; set; }\n\n    public Info Info { get; set; }\n}<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">case 2<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >public class Retrieve\n{\n    [XmlElement(\"Air\")] \/\/ \ucee8\ud14c\uc774\ub108 \uc81c\uac70\ud558\uace0 \uc694\uc18c \uc9c1\uc811 \ubc18\ubcf5\n    public Air[] Air { get; set; }\n\n    [XmlElement(\"Info\")]\n    public Info Info { get; set; }\n}<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\uc9c1\uc5f4\ud654 case1<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:xhtml decode:true \" >\n&lt;Retrieve&gt;\n  &lt;Air&gt;          &lt;!-- \ubc30\uc5f4 \uc18d\uc131 \uc774\ub984 --&gt;\n    &lt;Air&gt;\u2026&lt;\/Air&gt;  &lt;!-- \ubc30\uc5f4 \uc6d0\uc18c\uc758 \uc774\ub984 --&gt;\n    &lt;Air&gt;\u2026&lt;\/Air&gt;\n  &lt;\/Air&gt;\n  &lt;Info&gt;\u2026&lt;\/Info&gt;\n&lt;\/Retrieve&gt;<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\uc9c1\uc5f4\ud654 case2<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:xhtml decode:true \" >&lt;Retrieve&gt;\n\n    &lt;Air&gt;\u2026&lt;\/Air&gt;  &lt;!-- \ubc30\uc5f4 \uc6d0\uc18c\uc758 \uc774\ub984 --&gt;\n    &lt;Air&gt;\u2026&lt;\/Air&gt;\n\n  &lt;Info&gt;\u2026&lt;\/Info&gt;\n&lt;\/Retrieve&gt;<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\ubc30\uc5f4 \uc18d\uc131 \uc704\uc5d0 <code>[XmlElement]<\/code> \ud2b9\uc131\uc744 \ubd99\uc774\uba74,<br><strong>\ucee8\ud14c\uc774\ub108 \uc5c6\uc774 \ubc14\ub85c &lt;Air> \uc694\uc18c\ub4e4\ub9cc \ub098\uc5f4<\/strong>\ub429\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">[XmlArray] \/ [XmlArrayItem]\uc640\uc758 \ucc28\uc774<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\ucee8\ud14c\uc774\ub108\ub97c \uc6d0\ud55c\ub2e4\uba74:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >\npublic class Retrieve\n{\n    [XmlArray(\"Air\")]                 \/\/ \ucee8\ud14c\uc774\ub108 \uc774\ub984 \uc9c0\uc815\n    [XmlArrayItem(\"Air\")]             \/\/ \uc544\uc774\ud15c \uc774\ub984 \uc9c0\uc815\n    public Air[] Air { get; set; }\n}<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:xhtml decode:true \" >\n&lt;Retrieve&gt;\n  &lt;Air&gt;          &lt;!-- \ubc30\uc5f4 \uc18d\uc131 \uc774\ub984 --&gt;\n    &lt;Air&gt;\u2026&lt;\/Air&gt;  &lt;!-- \ubc30\uc5f4 \uc6d0\uc18c\uc758 \uc774\ub984 --&gt;\n    &lt;Air&gt;\u2026&lt;\/Air&gt;\n  &lt;\/Air&gt;\n  &lt;Info&gt;\u2026&lt;\/Info&gt;\n&lt;\/Retrieve&gt;<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uc2a4\ud0a4\ub9c8\uac00 \ubc18\ubcf5\uc744 \uc9c1\uc811 \uc694\uad6c \u2192 [XmlElement(&#8220;Air&#8221;)]<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\uc2a4\ud0a4\ub9c8\uac00 \ucee8\ud14c\uc774\ub108 \uc544\ub798 \ubc18\ubcf5\uc744 \uc694\uad6c \u2192 [XmlArray] + [XmlArrayItem(&#8220;Air&#8221;)]<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\uc790\uc8fc \ud558\ub294 \uc2e4\uc218 &amp; \ud301<br>\ube48 \ubc30\uc5f4\/\ub9ac\uc2a4\ud2b8\uc77c \ub54c \ucd9c\ub825<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">[XmlElement(&#8220;Air&#8221;)]: \uc694\uc18c\uac00 0\uac1c\uba74 \uc544\ubb34\uac83\ub3c4 \ucd9c\ub825\ub418\uc9c0 \uc54a\uc74c (\ucee8\ud14c\uc774\ub108\uac00 \uc5c6\uc73c\ub2c8\uae4c).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[XmlArray]: \ube48 \ucee8\ud14c\uc774\ub108 \uac00 \ucd9c\ub825\ub420 \uc218 \uc788\uc74c (\ub9ac\uc2a4\ud2b8\uac00 empty\uc77c \ub54c).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud2b9\uc815 \uc2a4\ud0a4\ub9c8\uac00 \u201c\ube48 \ucee8\ud14c\uc774\ub108\ub77c\ub3c4 \uaf2d \uc788\uc5b4\uc57c \ud568\u201d\uc744 \uc694\uad6c\ud55c\ub2e4\uba74 XmlArray\ub97c \uc4f0\ub294 \uac8c \ub0ab\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uc21c\uc11c \uc81c\uc5b4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">XmlSerializer\ub294 \ubcf4\ud1b5 \uc120\uc5b8 \uc21c\uc11c\ub300\ub85c \uc694\uc18c\ub97c \ucd9c\ub825\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud544\uc694\ud558\uba74 [XmlElement(Order = n)] \ub97c \ud615\uc81c \uc18d\uc131\ub4e4\uc5d0 \ubd80\uc5ec\ud574 \uc815\ud655\ud55c \uc21c\uc11c\ub97c \ub9de\ucd9c \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >\npublic class PNRBFRetrieve\n{\n    [XmlElement(Order = 1)]\n    public Info Info { get; set; }\n\n    [XmlElement(\"Air\", Order = 2)]\n    public Air[] Air { get; set; }\n}<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\ub124\uc784\uc2a4\ud398\uc774\uc2a4 \uc9c0\uc815<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\uc694\uc18c\uc5d0 \ub124\uc784\uc2a4\ud398\uc774\uc2a4\ub97c \uac15\uc81c\ud558\ub824\uba74 [XmlElement(&#8220;Air&#8221;, Namespace=&#8221;\u2026&#8221;)] \ucc98\ub7fc \uc9c0\uc815\ud558\uc138\uc694.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub8e8\ud2b8\/\ud0c0\uc785 \uc218\uc900 \ub124\uc784\uc2a4\ud398\uc774\uc2a4\ub294 [XmlRoot(Namespace=&#8221;\u2026&#8221;)], [XmlType(Namespace=&#8221;\u2026&#8221;)] \ub4f1\uc73c\ub85c \uc9c0\uc815.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">List vs \ubc30\uc5f4<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">List\ub3c4 \ub3d9\uc77c\ud558\uac8c \ub3d9\uc791\ud569\ub2c8\ub2e4. \ube48\/\uac00\ubcc0 \uceec\ub809\uc158 \uad00\ub9ac\uac00 \uc26c\uc6cc \uc2e4\ubb34\uc5d0\uc11c\ub294 List\ub97c \uc120\ud638\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc608:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >[XmlElement(\"Air\")]\npublic List&lt;Air&gt; Air { get; set; } = new();<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\uc544\uc774\ud15c \uc774\ub984 \ucee4\uc2a4\ud130\ub9c8\uc774\uc988<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">[XmlElement(&#8220;ItemName&#8221;)]\uc758 &#8220;ItemName&#8221;\uc740 \uac01 \uc544\uc774\ud15c \uc694\uc18c\uc758 \ud0dc\uadf8\uba85\uc785\ub2c8\ub2e4.<br>\uc18d\uc131\uba85\uc774 Air\uc5ec\ub3c4 \uc544\uc774\ud15c\uba85\uc744 Air\ub85c \uc720\uc9c0\ud558\ub824\uba74:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >[XmlElement(\"Air\")]\npublic Air[] Air { get; set; }<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>\ucc28\uc774 case 1 case 2 \uc9c1\uc5f4\ud654 case1 \uc9c1\uc5f4\ud654 case2 \ubc30\uc5f4 \uc18d\uc131 \uc704\uc5d0 [XmlElement] \ud2b9\uc131\uc744 \ubd99\uc774\uba74,\ucee8\ud14c\uc774\ub108 \uc5c6\uc774 \ubc14\ub85c &lt;Air> \uc694\uc18c\ub4e4\ub9cc \ub098\uc5f4\ub429\ub2c8\ub2e4. [XmlArray] \/ [XmlArrayItem]\uc640\uc758 \ucc28\uc774 \ucee8\ud14c\uc774\ub108\ub97c <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=9837\" title=\"[XmlElement] \ud2b9\uc131\">[&#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-9837","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\/9837","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=9837"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/9837\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}