읽어들일 XML 파일 'booklist.xml' 기초에서 실무까지 XML 신민철 프리렉 35000 사랑과 전쟁 이사랑 전쟁문화사 15000 마이크로 소프트 빌 게이츠 마소문화사 20000 액션가면부인 바람났네 짱구 짱구출판사 12000 이번 예제는 XmlAttributeCollection을 이용해 element에 속한 attribute를 collection으로 가져와서 loop를 이용해 출력하는 예제를보여준다. using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Xml; namespace CH11 { class p559_FindAttribute { static void Main()..
읽어들일 XML 파일 'booklist.xml' 기초에서 실무까지 XML 신민철 프리렉 35000 사랑과 전쟁 이사랑 전쟁문화사 15000 마이크로 소프트 빌 게이츠 마소문화사 20000 액션가면부인 바람났네 짱구 짱구출판사 12000 이번 예제는 NextSibling, PreviousSibling을 이용해서 Element의 앞, 뒤 노드를 탐색하는 예제입니다. using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Xml; namespace CH11 { class p557 { static void Main() { string filePath = @"..\..\booklist.xml"..
읽어들일 XML 파일 'booklist.xml' 기초에서 실무까지 XML 신민철 프리렉 35000 사랑과 전쟁 이사랑 전쟁문화사 15000 마이크로 소프트 빌 게이츠 마소문화사 20000 액션가면부인 바람났네 짱구 짱구출판사 12000 위 문서를 C#으로 읽어 들이기 위해 XmlDocument 개체를 이용한다. using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Xml; namespace CH11 { class p556 { static void Main() { string filePath = @"..\..\booklist.xml"; XmlDocument xDoc = new XmlD..
읽어들일 XML 파일 'booklist.xml' 기초에서 실무까지 XML 신민철 프리렉 35000 사랑과 전쟁 이사랑 전쟁문화사 15000 마이크로 소프트 빌 게이츠 마소문화사 20000 액션가면부인 바람났네 짱구 짱구출판사 12000 위 문서를 C#으로 읽어 들이기 위해 XmlDocument 개체를 이용한다. using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Xml; namespace CH11 { class p554 { static void Main() { string filePath = @"..\..\booklist.xml"; XmlDocument xDoc = new XmlD..
Ruby(루비)를 이용해 Lotto(로또:복권의 종류) 번호를 생성하는 예제 코드입니다. Lotto = (1..45).sort_by{rand}[0,6] puts Lotto.join(', ') 역시 Ruby(루비)답게 간결한 코드로 표현이 되는군요. 무서운 루비 Ref URI : http://www.codeway.co.kr/board/bbs/board.php?bo_table=Ruby_Lecture&wr_id=9 Technorati tags: Lotto, Ruby del.icio.us tags: Lotto, Ruby
URI 의 Query string을 자바스크립트에서 직접적으로 사용하기에는 문제가 있다. 이를 변수로 이용하기 위해서는 문자열을 기준으로 분리를 해내야 하는데, 이러한 문제를 아래의 코드를 이용하거나 함수로 만들면 해결 될 수 있다. var se = document.location.search.substr(1); var qa = {}; // query array se.replace(/([^=]+)=([^&]*)(&|$)/g, function(){ qa[arguments[1]] = arguments[2]; return arguments[0]; }); 원문 참조. 만약 URL이 somefile.html?a=bc&def=ghijk 라면... dnl 코드를 실행한 후 - 혹은 함수로 만드셔도 됩니다 - qa.d..