본문 바로가기
개발/게임) 개발관련

개발관련)XmlDocument 클래스

by 테샤르 2022. 6. 21.

XmlDocument 클래스

XML(Extensible Markup Lanuage)를 읽기 위한 클래스로 

XML형식의 데이터를 읽거나, 편집, 유효성 검사 등을 수행할수 있다.

 

 

반응형
public void GetBookInformation(ref string title, ref string ISBN, ref string publicationDate,
    ref string price, ref string genre, XmlNode book)
{
    XmlElement bookElement = (XmlElement)book;

    // Get the attributes of a book.
    XmlAttribute attr = bookElement.GetAttributeNode("ISBN");
    ISBN = attr.InnerXml;

    attr = bookElement.GetAttributeNode("genre");
    genre = attr.InnerXml;

    attr = bookElement.GetAttributeNode("publicationdate");
    publicationDate = attr.InnerXml;

    // Get the values of child elements of a book.
    title = bookElement["title"].InnerText;
    price = bookElement["price"].InnerText;
}

 

Microsoft XmlDocument 클래스 : [ 링크 ]

 

XmlDocument 클래스 (System.Xml)

XML 문서를 나타냅니다. 이 클래스를 사용하여 문서에서 XML 로드, 유효성 검사, 편집, 추가 및 위치 지정을 수행할 수 있습니다.

docs.microsoft.com

 

 

★☆☆☆☆

 

 

반응형

댓글