티스토리 뷰


MSXML사용시 DTD( <!DOCTYPE ...> ) 가 포함된 xml문서의 경우 DomDocument::load()함수가 실패합니다.
xml문서의 유효성검사를 FALSE를 주면 해결이 됩니다.

m_pDoc->validateOnParse = VARIANT_FALSE;



DOM Document를 사용중 MSXML6을 사용하니까 갑자기 잘 읽히던 XML문서가 에러를 밷어서 확인해 보니 MSXML6.0 이하의 경우 ProhibitDTD 프로퍼티가 디폴트로 FALSE였었는데 6.0으로 오면서 디폴트 값이 TRUE로 되어있습니다.

m_pDoc->setProperty(_bstr_t(_T("ProhibitDTD")),_variant_t(false));


 


이렇게 해결..

MSDN문서에 아래와 같이 기술되어 있네요.

ProhibitDTD Property

Specifies whether to prohibit (true) or allow (false) the inclusion of a DTD in the XML DOM document.

This property is supported in MSXML 3.0 SP5, 4.0 SP3, 5.0 SP2, and 6.0. The default value is false for 3.0, 4.0, and 5.0. The default value is true for 6.0.

This property has security implications. For more information, see MSXML Security Overview and DOM Security.



http://msdn.microsoft.com/en-us/library/ms762632.aspx

http://social.msdn.microsoft.com/forums/en-US/xmlandnetfx/thread/4a01af90-2cb6-4311-bc87-531d83d3456e/

'개발' 카테고리의 다른 글

Hotkey Agent 1.0  (0) 2009.12.28
SimpleMP3  (0) 2009.10.12
simpleAdo 20081112b  (0) 2008.11.12
MS-SQL에서 ALTER TABLE로 컬럼생성시 위치지정하기  (0) 2008.11.12
파일 존재여부 확인  (0) 2008.09.11
댓글