article search result of 'XML' : 2

  1. 2011.01.10 [LINQ _ XML] 간략한 LINQ to XML 사용법 (167)
  2. 2010.12.04 [Simple Text Writer V0.1] 간편한 파일 쓰기 어플 (65)

[LINQ _ XML] 간략한 LINQ to XML 사용법


샘플 XML
<?xml version="1.0" encoding="utf-8" ?>
<root>
  <config>
    <Rootposition x="100" y="100"/>
  </config>

  <adData>
    <content name="samsung">
      <keyVisual x="0" y="0">http://www.samsung.com/us/boosted</keyVisual>
      <mov x="100" y="120">SAMSUNG MOV</mov>
    </content>

    <content name="hyundai">
      <keyVisual x="0" y="0">http://www.hyundai.com/kr/main.aspx</keyVisual>
      <mov x="20" y="200">HYUNDAI MOV</mov>
    </content>

    <content name="lg">
      <keyVisual x="20" y="0">http://www.lg.co.kr/</keyVisual>
      <mov x="330" y="300">LG MOV</mov>
    </content>
  </adData>
</root>
 
 
 
C# [Linq _ XML]
 
Created with colorer-take5 library. Type 'csharp'

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Xml.Linq;
using System.Text;
using System.Windows.Forms;

namespace LINQ_XML_test1
{
    public partial class Form1 : Form
    {
        public TRACE.TraceDele trace = new TRACE.TraceDele(TRACE.getTrace);
        public Form1()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {

            //간단��게 xml 문서를 로드 한다.
            XElement xe = XElement.Load("Sample.xml");

            //Descendants는 Child ,  즉 XML.Child( "adData" ).Child( "adData" ) �� 논리로 생각��면 ��겠다.
            //이로서 검출될 item 의 범위를 정한다.
            //
            //select 로 xmlQuery 에 반환될 형식을 정한다.
            //본 코드는 리스트화 하기위해 'SampleResult'라 하였지만
            //익명메서드 꼴인 'new {...}' 을 사용하거나 item을 바로 반환 하여도 동작가능하다.
            var xmlQuery = from item in xe.Descendants("adData").Descendants("content") 
                           select new SampleResult
                           {
                               //Element 일경우 Value를 반환지 않으면 xml 태그가 그대로 반환된다.
                               KeyVisual = item.Element("keyVisual").Value,
                               mov = item.Element("mov").Value,
                               //Attribute 일경우 String 으로 반환기때문에 적절한 타입케스팅이 필요하다.
                               movPosition = new Point((int)item.Element("mov").Attribute("x") , (int)item.Element("mov").Attribute("y"))
                           };

            //결과를 담을 리스트
            List<SampleResult> sList = new List<SampleResult>();
            foreach (var result in xmlQuery)
            {
                sList.Add(result);
                trace(result.mov, "###", result.KeyVisual , "###" ,result.movPosition);
            }
            base.OnLoad(e);
        }
    }

    //샘플리스트 클래스
    class SampleResult
    {
        public String KeyVisual { get; set; }
        public String mov { get; set; }
        public Point movPosition { get; set; }
        public override string ToString()
        {
            return KeyVisual + " " + mov +" " + movPosition;
        }
    }
}
Yamecoder 야매코더_
tags : c#, LINQ, XML
C# 2011. 1. 10. 18:03

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon wholesale nba jerseys 2014.11.13 22:03  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  3. BlogIcon The North Face Outlet 2014.11.19 20:45  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  4. BlogIcon The North Face Outlet 2014.11.25 02:56  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  5. BlogIcon blouson moncler 2014.11.28 08:27  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  6. 匿名 2014.12.03 05:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  7. 匿名 2014.12.03 05:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  8. BlogIcon cheap moncler coats 2014.12.03 10:46  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  9. BlogIcon wholesale nhl jerseys 2014.12.05 00:01  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  10. BlogIcon wholesale nba jerseys 2014.12.05 00:02  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  11. BlogIcon Detroit Red Wings Jerseys 2014.12.27 08:16  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  12. BlogIcon moncler jassen dames zwart 2014.12.28 13:52  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  13. BlogIcon Moncler Triomphe Jacket 2014.12.30 08:19  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  14. 匿名 2015.01.15 12:22  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  15. 匿名 2015.01.19 10:55  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  16. BlogIcon Men Tank Top 2015.01.29 01:34  수정/삭제  댓글쓰기

    네어Carolina Panthers Jerseys ,Wholesale Nba JerseysDenver Broncos jerseys Colorado Avalanche Jerseys Edmonton Oilers Jerseys





    The veteran outside linebacker was brought in for a pass-rush boosting role off the bench,Cheap Lakers Jerseys Usa.습지

  17. BlogIcon Syracuse University Jerseys 2015.01.29 18:18  수정/삭제  댓글쓰기

    지뉴Baltimore Ravens philadelphia eagles jerseys houston texans tshirts ,Philadelphia Phillies JerseysMiami Dolphins Jerseys



    OH,2014 2015 Soccer Jersey, NO,Wholesale Cheap Ncaa Jerseys, ROMO: The thinking was that Dallas' defense would be its downfall this season. That might be,cheap nhl jerseys, but Tony Romo's first game since back surgery featured three first-half interceptions in a home lo있일

  18. BlogIcon cheap nhl jerseys 2015.01.29 18:19  수정/삭제  댓글쓰기

    야단dez bryant jersey shirt ,Buy Soccer Uniformswholesale nfl jerseys supply philadelphia eagles jerseys cheap adidas Pelicans jerseys





    2. And at the other end of that road,West Virginia Mountaineers Jerseys, literally,NFL Short, there's Mike DiMuro. Road teams have gone 17-6 when he's worked the plate. Maybe he just has a sympathetic place in his heart for suitcases.겠방

  19. BlogIcon burberry femme pas cher 2015.03.27 21:10  수정/삭제  댓글쓰기

    그없il n'y a pas de fonctionnaires combien attrayante, la sixi&egrave;me empereur, ajouter "place" Wechat, le produit fini. de r&eacute;pondre &agrave; une de ces filles, pauvre.
    les travailleurs &agrave; Shanghai pour burberry soldes s'emparer du pouvoir,Peut - tre et de la g&eacute;n&eacute;tique,20 jours, de saisir l'occasion de soutenir et d'une s&eacute;rie d'orientations tr&egrave;s sp&eacute;립리

  20. BlogIcon femme burberry soldes 2015.03.30 11:27  수정/삭제  댓글쓰기

    가어& nbsp; de nombreux h&eacute;ros Wan tels que

    burberry parfum pas cher Chhnang

    l'histoire de la Chine, mais un h&eacute;ros national est, par rapport &agrave; d'autres personnes, c'est un h&eacute;ros national Chenggong mieux.Ne dis rien, il a dit que les habitants de la burberry parfum femme pas cher colonie n&eacute;erlandaise a le droit de retirer de Tawan et de la confiance que les gens적메

  21. 匿名 2015.04.08 09:20  수정/삭제  댓글쓰기

    메일火车采集器html简单模板示范






    Review of the Rally Insurance Group







    [标签:来源]








    This Insurance Group offers the best prices on collector car insurance with complete insurance protection for Kit cars including the Cobra, collector cars, classic cars,How to Get the Best Football Kit From the Football, antique auto cars, pro-street, tuner, muscle cars including the Grand Nati료예

[Simple Text Writer V0.1] 간편한 파일 쓰기 어플


간편한 파일 쓰기 어플



client code (AS3)

flush 규칙!


         파일경로(filePath):::내용(content) + "\n"

(':::' 요걸로 파일경로와 내용을 구분합니다.)


ex >> "c:\\sampleFolder\\childFolder\\content.xml"
         +":::
         +xml.toString()
         +"\n";


그냥 자기 컴퓨터에서 돌아가는 로컬용 입니다.(웹은 당연 안돌아가겠죠)
대용량은 테스트 안해봤습니다.
하루 종일 돌려보진 않았습니다.
피드백은 덧글로..
버전업은 할수 있을지. ,, 과연 = =;
옵션도 넣고 하려 했지만.. 일을 줄이기 위해 만드는건데, 이게 더 일이 될것 같아서 딱 필요한것만 구현했습니다.
Yamecoder 야매코더_
C# 2010. 12. 4. 02:35

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon doudoune moncler femme 2014.11.28 08:27  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  3. BlogIcon canada goose expedition parka 2014.11.29 06:32  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  4. BlogIcon canada goose expedition parka 2014.12.03 03:01  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  5. BlogIcon moncler italia 2014.12.03 04:03  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  6. 匿名 2014.12.03 05:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  7. BlogIcon moncler jersey coat 2014.12.05 04:02  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  8. BlogIcon furla bags online 2015.01.02 18:11  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  9. 匿名 2015.01.15 12:21  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  10. 匿名 2015.01.19 10:54  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  11. BlogIcon furla bags sale 2015.02.02 02:01  수정/삭제  댓글쓰기

    관는PNC Financial And Keycorp In November

    "I am more and more impressed with the possibilities of history's repeating itself on many different counts, " Benjamin Graham

    Given market enthusiasm following the temporarily resolution of discord in Washington,louis vuitton handbags, it's probably not a stretch to guess a return of partisanship ahead of January's budget debate will provide investors w예일

  12. BlogIcon burberry purses outlet 2015.02.18 19:18  수정/삭제  댓글쓰기

    법간Rating the flavor landing along with 3 treat quality recipes

    Listed here are 3 meals methods that will help you property which proverbial landing whilst friends and family chow lower throughout the Extremely Dish. As well as all these successful performs could be performed mainly ahead of time to help you benefit from the online game as well.

    Strategy the treat assault. Certain, you are able일가

  13. BlogIcon tory burch reva flats 2015.03.07 16:31  수정/삭제  댓글쓰기

    는가ligaments orthopedic

    My boyfriend is in his early 30s, average weight and height, and does not exercise very often other than the occasional game of tennis.

    Last week, he twisted his ankle while walking,mont blanc outlet, felt searing pain, and was immobile for two days. He did the usual rest, ice, compression, elevation routine, and it seems totally fine now.

    A few months ago, he woke up서료

  14. BlogIcon oakley sunglassses outlet 2015.03.18 21:30  수정/삭제  댓글쓰기

    일서Inside Senegalese shoes money

    NGAYE MEKHE, Senegal (AP) It is utilized years regarding cobblers with this particular city to understand the particular pointy toed slip-ons the moment well-liked by close by nobleman, now thought to be an important design product related to properly fitted Senegalese guys.

    This particular simply needed many weeks for your Oriental to be able to replicate in ad스수

  15. BlogIcon discount oakley sunglasses 2015.03.18 21:58  수정/삭제  댓글쓰기

    리예Steps to make the Hemp Band along with 2 Colours

    Hemp anklet bracelets which are therefore well-liked amongst teens these days,louis vuitton luggage set, because of their own design quotient as well as cost are manufactured from the grow which is one of the exact same genus since the grow that marijuana comes. Hemp, the actual grow that produces the actual through item for that produce associat가데

  16. BlogIcon furla candy purse 2015.03.19 01:00  수정/삭제  댓글쓰기

    선수Marriage ceremony Treat Adornments In addition to Marriage ceremony Treat Dessert cake toppers

    Marriage ceremony treat toppings in addition to Marriage ceremony treat adornments (aka Marriage ceremony treat toppers) will be the outgrowth related to several older traditions via worldwide. In the united states Marriage ceremony treat toppings, adornments, in addition to dessert cake toppers resul습리

  17. BlogIcon mont blanc wallets 2015.03.24 02:41  수정/삭제  댓글쓰기

    마어6 crucial Obamacare times to view with regard to within 2014

    The actual arriving 12 months would have been a critical 1 for that Inexpensive Treatment Behave: The actual primary aspects of the actual capturing healthcare regulation get into complete impact, a few of the last customer rights is going to be in position, and also the midterm elections may once again place the regulation within the데일

  18. BlogIcon vetement burberry 2015.03.27 21:10  수정/삭제  댓글쓰기

    상어car c'est > mais il veut pas >Yi 劻 n'est pas du tout comme serviteur a pris le rouge. de r&eacute;alisations mais aussi de r&eacute;alisations. et a ordonn&eacute; d'abandonner la ville sous - Direction Aihui, et de la Chine).- patrouille recommand&eacute;e par 100 de l'or,e sauf a particip&eacute; &agrave; la campagne de Shanghai l'agitation des dizaines de fois,| | casser quelques œufs nid?Mais 마습

  19. BlogIcon oakley outlet 2015.04.01 21:03  수정/삭제  댓글쓰기

    어리stated simon,michael kors purse

    This created a person appear instantly youthful as well as stylish, such as azure denim jeans within the sixties. This experienced the non-fashiony attractiveness. This came upon army as well as wearing prototypes. All of us appreciate heading out to consume each and every right now as well as dealing with ourself to some great dinner. There are many inexpensive 분리

  20. BlogIcon oakley store 2015.04.13 01:23  수정/삭제  댓글쓰기

    전일Identify Verbals as well as Spoken Key phrases

    This can be a type that's been visiting the actual fore a lot more within the present times whenever talking about things like a great guide. Individuals may state that it's a great 'read'. The 'verbal' is really a action-word type which features inside a phrase like a noun, a good adjective, or even a good adverb. The 'verbal phrase' is really a s있드

  21. BlogIcon oakley outlet 2015.04.14 13:49  수정/삭제  댓글쓰기

    정이Metal Policeman arranged with regard to triathalon fundraiser

    The actual Halifax Local Law enforcement sergeant isn basically match. Your woman carried out a lot of fifty percent triathlons your woman may depend all of them. Upon August.

    Hart locomotives no less than 3 several hours each day, along with a optimum 10 which following a 10 hr change.

    For all those people that wear invest fif단지

Powerd by Tistory, designed by criuce
rss