Microsoft XML 3.0 Âü°í»çÇ×

XML ¼Ò½ºÀÇ ÃÖ°í ¼öÁØÀ» ´ëÇ¥ÇÏ¸ç ¸ðµç ´Ù¸¥ XML °³Ã¼¸¦ ¹ÝȯÇϰųª »ý¼ºÇÏ´Â ±¸¼º¿øµéÀ» °¡Áö°í ÀÖ´Ù.

Script [propVal=]..propName;
HTML ¾ø´Ù.
Ư±â

DOMDocumentÀº ¹®¼­ °èÅëµµ¿¡¼­ ÃÖ»óÀ§ ¼öÁØÀÌ´Ù. ÀÌ´Â ±âÃÊ DOM(Document Object Model) ¹®¼­ÀÇ ¸Þ¼­µåµéÀ» Àû¿ëÇÏ°í XSL(Extensible Stylesheet Language)¿Í XML º¯È¯À» Áö¿ø Ãß°¡ÀûÀÎ ±¸¼º¿øµéÀ» °®´Â´Ù.

ÇÑ°³ÀÇ ¹®¼­¸¸À» »ý¼ºÇÒ ¼ö ÀÖ°í, ¸ðµç ´Ù¸¥ °³Ã¼µéÀº ±× ¹®¼­À» ÅëÇÏ¿© Á¢¼ÓµÇ°í »ý¼ºµÉ ¼ö ÀÖ´Ù.

¹®¼­´Â free-threaded³ª rental-threaded µÎ°¡Áö ¸ðµ¨·Î »ý¼ºµÉ ¼ö ÀÖ´Ù. ÀÌ µÎ±âÁö ¸ðµ¨Àº µ¿ÀÏÇÏ´Ù.
Æļ­(parser)°¡ ¿©·¯ °¡´Ú(thread)µé¿¡ µ¿½ÃÀûÀ¸·Î Á¢¼ÓÇÒ ÇÊ¿ä°¡ ¾øÀ¸¹Ç·Î rental-threadedÀÇ ¼º´ÉÀÌ ´õ ÁÁ´Ù.
´Ù¸¥ ¸ðµ¨µé·Î »ý¼ºµÈ ³ëµå(node)³ª ¹®¼­µé¸¦ ¼¯¾î »ç¿ëÇÒ ¼ö ¾ø´Ù.

¹®¼­ÀÇ ½º·¹µù ¸ðµ¨(threading model) ¼³Á¤Àº ´ÙÀ½°ú °°ÀÌ ÇÑ´Ù.

¼³Á¤ Rental-threaded ¸ðµ¨ Free-threaded ¸ðµ¨
¹öÀü¿¡ µ¶¸³ÀûÀÎ ProgID Msxml2.DOMDocument Msxml2.FreeThreadedDOMDocument
ProgID Msxml2.DOMDocument.3.0 Msxml2.FreeThreadedDOMDocument.3.0
ClassID F6D90F11-9C73-11D3-B32E-00C04F990BB4 F6D90F12-9C73-11D3-B32E-00C04F990BB4
VB Class Name DOMDocument30 FreeThreadedDOMDocument30
Âü°í
XML

¼³¸íÀ» À§ÇÑ ¿¹Á¦

Script rental-threaded, free-threaded µÎ°¡Áö ¸ðµ¨·Î »ý¼ºÇÑ´Ù.
var objDoc = new ActiveXObject("Msxml2.DOMDocument");
var objFTDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
Visual Basic rental-threaded, free-threaded µÎ°¡Áö ¸ðµ¨·Î »ý¼ºÇÑ´Ù.
Dim objDoc As New Msxml2.DOMDocument
Dim objFTDoc As New Msxml2.FreeThreadedDOMDocument
C/C++ ´Ù¸¥ ÀÎÅÍÆäÀ̽º¸¦ À§ÇÏ¿© DOMDocument°ú Äõ¸®¸¦ »ý¼ºÇÑ´Ù.
HRESULT hr;
IXMLDOMDocument*pXMLDoc;
IXMLDOMNode*pXDN;
hr=CoInitialize(NULL);
hr=CoCreateInstance(CLSID_DOMDocument,NULL,CLSCTX_INPROC_SERVER,
  IID_IXMLDOMDocument,(void**)&pXMLDoc);
hr=pXMLDoc->QueryInterface(IID_IXMLDOMNode,(void **)&pXDN); //  ¹Ýȯ°ªÀ» Á¡°ËÇÑ´Ù.

ÀÎÅÍÆäÀ̽º(interface)

DOM ÀÎÅÍÆäÀ̽º¿¡ Ãß°¡ÀûÀ¸·Î, DOMDocumentÀº ¿©·¯ Ç¥ÁØ COM ÀÎÅÍÆäÀ̽ºµé¸¦ Àû¿ëÇÑ´Ù.
DOMDocument¿¡¼­ QueryInterface ¸Þ¼­µå¸¦ È£ÃâÇÏ¿© ´ÙÀ½ ÀÎÅÍÆäÀ̽ºµé¸¦ ¾ò¸¦ ¼ö ÀÖ´Ù.

ÀÎÅÍÆäÀ̽º ¿ëµµ
IUnknown DOMDocument´Â ½Î´Â(wrapper) °³Ã¼ÀÌ°í °¢ DOMDocument Äõ¸®´Â »õ ½Î°³¸¦ Á¦°øÇÑ´Ù. IUnknown ÀÎÅÍÆäÀ̽º Áö½ÃÀڵ鸸 ºñ±³ÇÏ¸é µÈ´Ù.
IConnectionPointContainer IPropertyNotifySink::OnChanged°ú IDispatch::Invoke¸¦ ÅëÇÏ¿© ondataavailable°ú onreadystatechangeµî ³ª°¡´Â À̺¥Æ®µéÀ» Áö¿øÇÑ´Ù.
IDispatch Visual Basic¿¡ ÀÇÇØ »ç¿ëµÇ´Â ÀÎÅÍÆäÀ̽ºÀÌ´Ù.
IDispatchEx VBScript, javascript¿Í °°Àº ź·Â ½ºÅ©¸³Æ® ¾ð¾î¿¡ »ç¿ëµÇ´Â ÀÎÅÍÆäÀ̽º·Î ¿ÏÀüÈ÷ Àû¿ëµÇÁö´Â ¾Ê´Â´Ù.
DeleteMemberByName, DeleteMemberByDispID, GetMemberProperties, GetMemberName, GetNextDispID, GetNameSpaceParent ¸Þ¼­µåµéÀº Ç×»ó E_NOTIMPLÀ» ¹ÝȯÇÑ´Ù.
IMarshal free-threaded DOM ¹®¼­¿¡¼­ FreeThreadedMarshaler¸¦ ¾ò´Âµ¥ »ç¿ëµÉ ¼ö ÀÖ´Ù.
ASPÀÇ ½¦¾îµå ¼¼¼Ç(shared Session)°ú, º¹¼ö »ç¿ëÀÚ ¸Þ¸ð¸®À» ÅëÇÑ ½¦¾îµå XML ¹®¼­ÀÇ Àû¿ë»óÅ¿¡ »ç¿ëµÇ°Ô ÇÑ´Ù.
IObjectSafety 0ÀÌ ¾Æ´Ñ ¾ÈÀü ¿É¼ÇÀ¸·Î SetInterfaceSafetyOptions ¸Þ¼­µå°¡ È£ÃâµÇ¸é, Ms XML Parser(MSXML)´Â XML µ¥ÀÌÅ͸¦ °¡Á®¿À±â Àü¿¡ ¾ÈÀü ±ÔÄ¢À» Àû¿ëÇÑ´Ù.
IObjectWithSite ±âÃÊ ÁÖ¼Ò(base URL)¿Í °°Àº Ãß°¡ÀûÀÎ Á¤º¸ Á¦°øÀ» ¼­¹ö Àû¿ë¿¡¼­ °¡´ÉÇÏ°Ô ÇÑ´Ù.
IOleCommandTarget ºñµ¿±âÀû ´Ù¿î·Îµå¸¦ ÁßÁö½Ãų OLECMDID_STOP ¸í·ÉÀ» º¸³»±â À§ÇÑ COM ¿ë±â¿¡ ÀÇÇÏ¿© »ç¿ëµÈ´Ù.
IPersistMoniker XML ¹®¼­¸¦ ¿¬¼ÓÀûÀÎ µ¥ÀÌÅÍ¿¡ ¾î¶»°Ô ¹ÙÀεå ÇÒ °ÍÀΰ¡ÀÇ Á¦¾îÀ» Á¦°øÇÑ´Ù.
ÁÖ¾îÁø IMonikerÀÇ BindToStorage¸¦ »ç¿ëÇÏ¿© µ¿±âÀû°ú ºñµ¿±âÀû ·ÎµùÀÌ Áö¿øµÈ´Ù.
Save´Â È£ÃâµÇÁö ¾Ê¾Æ BindToStorage, IsDirty, SaveCompleted ¸Þ¼­µéµéÀº E_NOTIMPLÀ» ¹ÝȯÇÑ´Ù.
IPersistStream IStream°ú »çÀÌ¿¡¼­ XML ¹®¼­¸¦ ÀúÀåÇϰųª Àдµ¥ »ç¿ëµÈ´Ù .
IPersistStreamInit IPersistStreamÀÇ ¾÷µ¥ÀÌÆ®µÈ ¹öÀüÀÌ´Ù.
IProvideClassInfo DOMDocument ¹®¼­¿¡¼­ ITypeInfoÀ» ¾ò´Â ½¬¿î ¹æ¹ýÀ» Á¦°øÇÑ´Ù.
IStream ¹®¼­¿¡ Àб⠾²±â¸¦ ¹ÝȯµÈ IStreamÀ» ÅëÇÏ¿© Á÷Á¢ÀûÀ¸·Î ÇÒ¼ö ÀÖ°ÔÇÑ´Ù.
Write ÀÛ¾÷ Áß¿¡ SeekÇÒ ¼ö ¾øÀ¸¸ç, SetSize, CopyTo, Commit, Revert, LockRegion, UnlockRegion°ú Clone ¸Þ¼­µåµéÀº IStream¿¡ Àû¿ëµÇÁö ¾Ê´Â´Ù.
ÀÌ´Â XML ¹¶Ä¡µéÀ» Á¦°øÇÏ°í Write¸¦ È£ÃâÇÏ¿© XML ¹®¼­¸¦ È¿°úÀûÀ¸·Î ÀÛ¼ºÇÏ°ÔÇÑ´Ù.
"xmldoc1.save(xmldoc2)"À» È£ÃâÇÏ¿© ÇöÀç DOM ¹®¼­ÀÇ ¿ÏÀü¼ºÀ» Á¡°ËÇϴµ¥µµ ½Ã¿ëÇÒ ¼ö ÀÖ´Ù. Save ¸Þ¼­µåµµ ÀÌ IStream ÀÎÅ×ÆäÀ̽º¸¦ »ç¿ëÇÑ´Ù.

¹®¼­¿¡ createElement¿Í °°Àº °³Ã¼¸¦ »ý¼ºÇÏ´Â ¸Þ¼­µå°¡ »ç¿ëµÇ¸é ¹®¼­ ȯ°æ¿¡ ³ëµå(node)°¡ »ý¼ºµÈ´Ù(ownerDocument ¼Ó¼º ¹®¼­ÀÇ ³ëµå Áö½ÃÀÚ). ±×·¯³ª ³ëµå´Â ¹®¼­ °èÅëÀÇ ºÎºÐÀº ¾Æ´Ï´Ù.
³ëµå´Â insertBefore, replaceChild³ª appendChild ȤÀº ¾ÖÆ®¸®ºäÆ®¿¡¼­ setAttributeNode¸¦ »ç¿ëÇÏ¿© À» È£ÃâÇÏ¿© Áö¸íÀûÀ¸·Î ¹®¼­ °èÅë¿¡ Ãß°¡ÇØ¾ß ¹®¼­ °èÅëÀÇ ÀϺΰ¡ µÈ´Ù.

ÇÊ¿ä»çÇ×
C/C++ Àû¿ë(implementation): msxml3.dll, msxml2.lib
¸Ó¸´±Û°ú IDL ÆÄÀÏ: msxml2.h, msxml2.idl