2009년 11월 05일
[VB6] String을 XML 로 파싱
MSXML이 참조되어야 한다.
String이 XML 형식이 아니면 오류로 떨어진다. (아래 소스엔 예외처리 X)
파싱한 데이터를 FILE로 저장한다.
초간단 예제
===================================================================================================================
Dim xmldoc As New DOMDocument
Dim strXml As String
strXml = ""
strXml = strXml + "<Document> "
strXml = strXml + "<DocumentNo>DELADV-E1001131-D100-0813298526</DocumentNo>"
strXml = strXml + "<DocumentName>DELADV</DocumentName>"
strXml = strXml + "<DocumentDate>20090720113020</DocumentDate>"
strXml = strXml + "</Document>"
'MsgBox strXml
xmldoc.loadXML strXml
xmldoc.insertBefore xmldoc.createProcessingInstruction("xml", "version='1.0' encoding='EUC-KR'"), xmldoc.childNodes(0)
'MsgBox xmldoc.Text
xmldoc.save "c:\myxml.xml"
Set xmldoc = Nothing
===================================================================================================================
이 글과 관련있는 글을 자동검색한 결과입니다 [?]
- [Simple XML 파서 만들기] #1. 파싱 원리 by 시즈하
- [JavaScript] String을 XML로 변환 by Coder
- 다중 코드 변환에 대한 간단한 메모 by 치문
- Simple XML Parser - SIXP (for Smalltalk) by 시즈하
# by | 2009/11/05 11:56 | .NET | 트랙백 | 덧글(0)





☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]