약간은 어려운 내용일 수 있다. XmlDocument로는 문서와 Dataset과의 동기화가 되지 않아 XmlDataDocument를 이용하게된다. 아래는 이러한 내용을 보여주는 예제이다. using System; using System.Data; using System.Data.SqlClient; using System.Xml; namespace XmlDataDocumentUpdate { public class Class1 { static void Main(string[] args) { //DataAdapter 객체 생성 string strConn = "Data Source=localhost;Initial Catalog=booksourcedb;Integrated Security=True"; string ..
사용한 XML 문서는 이전 글을 참조하기 바란다. using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Xml.XPath; namespace CH11 { class p566_XPathNavagator { static void Main() { string filePath = @"..\..\booklist.xml"; XPathDocument xPathDoc = new XPathDocument(filePath); XPathNavigator xPathNavi = xPathDoc.CreateNavigator(); // XPath 반복기 XPathNodeIterator xPathNodeIter..
읽어들일 XML 파일 'booklist.xml' 기초에서 실무까지 XML 신민철 프리렉 35000 사랑과 전쟁 이사랑 전쟁문화사 15000 마이크로 소프트 빌 게이츠 마소문화사 20000 액션가면부인 바람났네 짱구 짱구출판사 12000 Xml Node를 XPath를 이용해서 선택하는 예제이다. 예제에서는 kind가 '컴퓨터'인 node를 선택하는 예제코드를 보여준다. using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Xml; namespace CH11 { class p564_FindXPath { static void Main() { string filePath = @"..\..\..
URL Reference : http://blog.jusun.org/tt/entry/XPath-expression XPath란 무엇인가? XPath는 XML 문서의 part를 정의하기 위한 syntax이다. XPath는 XML 문서 내부를 검색하기 위한 path expression을 사용한다. XPath는 표준함수의 라이브러리를 갖고 있다. XPath는 W3C 표준이다.Xpath의 노드 Xpath에는 7가지 종류의 Node가 존재한다. element, attribute, text, namespace, processing-instruction, comment, document(root)Node간의 관계 parent, children, sibling, ancestor, descendantXpath Synta..