VB.NET 2008/VB - XML

XML - XmlDocument 클래스를 사용한 XML 문서 접근

본클라쓰 2011. 5. 20. 10:33

 

 

XmlDocument 클래스는 W3C DOM(문서 개체 모델) level 1 core 및 Core DOM level 2를 구현한다.

 

DOM은 XML 문서의 메모리 내(캐시) 트리 표현이며 이를 사용하여 XML 문서를 탐색 및 편집할 수 있다. XmlDocument에서 IXPathNavigable 인터페이스를 구현하기 때문에 이를 XslTransform 클래스의 소스 문서로 사용할 수도 있다.

 

 

XmlDataDocument 클래스에서 XmlDocument를 확장하며 구조적 데이터를 관계형 DataSet을 통해 저장, 검색 및 처리할 수 있게 해준다. 이 클래스를 사용하면 구성 요소에서 XML과 내부 데이터의 관계형 보기를 혼합할 수 있다.

 

 

 

생성방법은

 

Dim settings As New XmlReaderSettings()

settings.ProhibitDtd = False

settings.ValidationType = ValidationType.DTD

Addhandler settings.ValidationEventHandler, eventHandler

 

dim reader As XmlReader = XmlReader.Create("book.xml", settings)

 

Dim doc As New XmlDocument()

doc.Load(reader)

 

Console.WriteLine(doc.OuterXml)

 

 

 

'VB.NET 2008 > VB - XML' 카테고리의 다른 글

XML - XmlWriter 클래스  (0) 2011.05.20
XML - XML DOM (문서 개체 모델) 개념  (0) 2011.05.20
XML - XmlReader 클래스  (0) 2011.05.20
XML - XML 문서  (0) 2011.05.20