47#undef CLSID_DOMDocument
49DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
50DEFINE_GUID(IID_transformdest_unknown,0xf5078f3a,0xc551,0x11d3,0x89,0xb9,0x00,0x00,0xf8,0x1f,0xe2,0x21);
64 { &
CLSID_DOMDocument,
"DOMDocument", {&IID_IXMLDOMDocument, &IID_IXMLDOMDocument2} },
65 { &CLSID_DOMDocument2,
"DOMDocument2", {&IID_IXMLDOMDocument, &IID_IXMLDOMDocument2} },
66 { &CLSID_DOMDocument30,
"DOMDocument30", {&IID_IXMLDOMDocument, &IID_IXMLDOMDocument2} },
67 { &CLSID_DOMDocument40,
"DOMDocument40", {&IID_IXMLDOMDocument, &IID_IXMLDOMDocument2} },
68 { &CLSID_DOMDocument60,
"DOMDocument60", {&IID_IXMLDOMDocument, &IID_IXMLDOMDocument2, &IID_IXMLDOMDocument3} },
69 { &CLSID_FreeThreadedDOMDocument,
"FreeThreadedDOMDocument", {&IID_IXMLDOMDocument, &IID_IXMLDOMDocument2} },
70 { &CLSID_XMLSchemaCache,
"XMLSchemaCache", {&IID_IXMLDOMSchemaCollection} },
71 { &CLSID_XSLTemplate,
"XSLTemplate", {&IID_IXSLTemplate} },
72 { &CLSID_MXNamespaceManager40,
"MXNamespaceManager40", {&IID_IMXNamespaceManager} },
82 return "IXMLDOMDocument";
84 return "IXMLDOMDocument2";
86 return "IXMLDOMDocument3";
88 return "IXMLDOMSchemaCollection";
90 return "IXSLTemplate";
92 return "IMXNamespaceManager";
108 if (
hr ==
S_OK) IUnknown_Release(unk);
159 IDispatch_AddRef( iface );
204 EXCEPINFO *excepInfo,
UINT *argErr)
216 ok(excepInfo ==
NULL,
"got %p\n", excepInfo);
217 ok(argErr ==
NULL,
"got %p\n", argErr);
241 return (
IDispatch*)&
event->IDispatch_iface;
270 ok(0,
"unexpected call\n");
282 ok(0,
"unexpected call\n");
288 ok(0,
"unexpected call\n");
295 ok(0,
"unexpected call\n");
301 ok(0,
"unexpected call\n");
307 ok(0,
"unexpected call\n");
314 ok(0,
"unexpected call\n");
321 ok(0,
"unexpected call\n");
327 ok(0,
"unexpected call\n");
333 ok(0,
"unexpected call\n");
367 ok(0,
"unexpected call\n");
383 ok(0,
"unexpected call\n");
389 ok(0,
"unexpected call\n");
396 ok(0,
"unexpected call\n");
403 ok(0,
"unexpected call\n");
409 ok(0,
"unexpected call\n");
415 ok(0,
"unexpected call\n");
421 ok(0,
"unexpected call\n");
427 ok(0,
"unexpected call\n");
433 ok(0,
"unexpected call\n");
439 ok(0,
"unexpected call\n");
445 ok(0,
"unexpected call\n");
451 ok(0,
"unexpected call\n");
457 ok(0,
"unexpected call\n");
463 ok(0,
"unexpected call\n");
469 ok(0,
"unexpected call\n");
475 ok(0,
"unexpected call\n");
481 ok(0,
"unexpected call\n");
487 ok(0,
"unexpected call\n");
500 ok(dim == 1,
"got wrong array dimensions %u\n", dim);
505 ok(bound == 0,
"wrong array low bound %d\n", bound);
510 ok(bound > 0,
"wrong array high bound %d\n", bound);
517 ok(0,
"unexpected call\n");
523 ok(0,
"unexpected call\n");
529 ok(0,
"unexpected call\n");
535 ok(0,
"unexpected call\n");
541 ok(0,
"unexpected call\n");
547 ok(0,
"unexpected call\n");
553 ok(0,
"unexpected call\n");
559 ok(0,
"unexpected call\n");
565 ok(0,
"unexpected call\n");
571 ok(0,
"unexpected call\n");
577 ok(0,
"unexpected call\n");
583 ok(0,
"unexpected call\n");
589 ok(0,
"unexpected call\n");
595 ok(0,
"unexpected call\n");
601 ok(0,
"unexpected call\n");
607 ok(0,
"unexpected call\n");
655#define EXPECT_CHILDREN(node) _expect_children((IXMLDOMNode*)node, __LINE__)
662 hr = IXMLDOMNode_hasChildNodes(
node, &
b);
663 ok_(__FILE__,
line)(
hr ==
S_OK,
"hasChildNodes() failed, 0x%08x\n",
hr);
664 ok_(__FILE__,
line)(
b == VARIANT_TRUE,
"no children, %d\n",
b);
667#define EXPECT_NO_CHILDREN(node) _expect_no_children((IXMLDOMNode*)node, __LINE__)
674 hr = IXMLDOMNode_hasChildNodes(
node, &
b);
676 ok_(__FILE__,
line)(
b == VARIANT_FALSE,
"no children, %d\n",
b);
679#define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__)
683 IUnknown_AddRef(
obj);
684 rc = IUnknown_Release(
obj);
685 ok_(__FILE__,
line)(rc ==
ref,
"expected refcount %d, got %d\n",
ref, rc);
688#define EXPECT_LIST_LEN(list,len) _expect_list_len(list, len, __LINE__)
700#define EXPECT_HR(hr,hr_exp) \
701 ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
704#define EXPECT_NOT_HR(hr,hr_exp) \
705 ok(hr != hr_exp, "got 0x%08x, expected not 0x%08x\n", hr, hr_exp)
710 '<',
'?',
'x',
'm',
'l',
' ',
711 'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'\'',
'1',
'.',
'0',
'\'',
'?',
'>',
'\n',0
714 '<',
'?',
'x',
'm',
'l',
' ',
715 'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'\'',
'1',
'.',
'0',
'\'',
'?',
'>',
'\n',
716 '<',
'o',
'p',
'e',
'n',
'>',
'<',
'/',
'o',
'p',
'e',
'n',
'>',
'\n',0
719 '<',
'?',
'x',
'm',
'l',
' ',
720 'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'\'',
'1',
'.',
'0',
'\'',
'?',
'>',
'\n',
721 '<',
'a',
'>',
'<',
'/',
'a',
'>',
'\n',0
724 "<?xml version=\'1.0\'?>\n"
726 "<bs vr=\'str2\' sz=\'1234\'>"
729 "<pr id=\'str3\' vr=\'1.2.3\' pn=\'wine 20050804\'>\n"
741 '<',
'S',
':',
's',
'e',
'a',
'r',
'c',
'h',
' ',
'x',
'm',
'l',
'n',
's',
':',
'D',
'=',
'"',
'D',
'A',
'V',
':',
'"',
' ',
742 'x',
'm',
'l',
'n',
's',
':',
'C',
'=',
'"',
'u',
'r',
'n',
':',
's',
'c',
'h',
'e',
'm',
'a',
's',
'-',
'm',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'-',
'c',
'o',
'm',
':',
'o',
'f',
'f',
'i',
'c',
'e',
':',
'c',
'l',
'i',
'p',
'g',
'a',
'l',
'l',
'e',
'r',
'y',
'"',
743 ' ',
'x',
'm',
'l',
'n',
's',
':',
'S',
'=',
'"',
'u',
'r',
'n',
':',
's',
'c',
'h',
'e',
'm',
'a',
's',
'-',
'm',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'-',
'c',
'o',
'm',
':',
'o',
'f',
'f',
'i',
'c',
'e',
':',
'c',
'l',
'i',
'p',
'g',
'a',
'l',
'l',
'e',
'r',
'y',
':',
's',
'e',
'a',
'r',
'c',
'h',
'"',
'>',
744 '<',
'S',
':',
's',
'c',
'o',
'p',
'e',
'>',
745 '<',
'S',
':',
'd',
'e',
'e',
'p',
'>',
'/',
'<',
'/',
'S',
':',
'd',
'e',
'e',
'p',
'>',
746 '<',
'/',
'S',
':',
's',
'c',
'o',
'p',
'e',
'>',
747 '<',
'S',
':',
'c',
'o',
'n',
't',
'e',
'n',
't',
'f',
'r',
'e',
'e',
't',
'e',
'x',
't',
'>',
748 '<',
'C',
':',
't',
'e',
'x',
't',
'o',
'r',
'p',
'r',
'o',
'p',
'e',
'r',
't',
'y',
'/',
'>',
749 'c',
'o',
'm',
'p',
'u',
't',
'e',
'r',
750 '<',
'/',
'S',
':',
'c',
'o',
'n',
't',
'e',
'n',
't',
'f',
'r',
'e',
'e',
't',
'e',
'x',
't',
'>',
751 '<',
'/',
'S',
':',
's',
'e',
'a',
'r',
'c',
'h',
'>',0
755 '<',
'?',
'x',
'm',
'l',
' ',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'=',
'\'',
'1',
'.',
'0',
'\'',
' ',
756 'e',
'n',
'c',
'o',
'd',
'i',
'n',
'g',
'=',
'\'',
'W',
'i',
'n',
'd',
'o',
'w',
's',
'-',
'1',
'2',
'5',
'2',
'\'',
'?',
'>',
'\n',
757 '<',
'o',
'p',
'e',
'n',
'>',
'<',
'/',
'o',
'p',
'e',
'n',
'>',
'\n',0
761 "<?xml version=\"1.0\"?>\n\t"
769#define DECL_WIN_1252 \
770"<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
783"<?xml version='1.0' encoding='utf-8'?>\n"
784"<root xmlns:foo='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29' a=\"attr a\" foo:b=\"attr b\" >\n"
790" <description xmlns:foo='http://www.winehq.org' xmlns:bar='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'>\n"
791" <html xmlns='http://www.w3.org/1999/xhtml'>\n"
792" <![CDATA[]]> This is<strong> a</strong> <i>description</i><dot>. </dot><bar:x/>\n"
794" <html xml:space='preserve' xmlns='http://www.w3.org/1999/xhtml'>\n"
795" This is <strong>a</strong> <i>description</i> with preserved whitespace. <bar:x/>\n"
803" <c type=\"old\">C2 field</c>\n"
807" <elem xmlns='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'>\n"
816" <foo:c>C4 field</foo:c>\n"
822"<?xml version='1.0'?>"
824"<b1> Text A end </b1>"
825"<b2>AB C </b2>"
829"<?xml version='1.0'?>"
830"<!-- comment node 0 -->"
831"<root id='0' depth='0'>"
832" <!-- comment node 1 -->"
834" <x id='1' depth='1'>"
835" <?foo value='PI for x'?>"
836" <!-- comment node 2 -->"
838" <a id='3' depth='2'/>"
839" <b id='4' depth='2'/>"
840" <c id='5' depth='2'/>"
842" <y id='2' depth='1'>"
843" <?bar value='PI for y'?>"
844" <!-- comment node 3 -->"
846" <a id='6' depth='2'/>"
847" <b id='7' depth='2'/>"
848" <c id='8' depth='2'/>"
853"<?xml version=\"1.0\"?>\n"
859"<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n"
860" <xsl:output method=\"html\"/>\n"
861" <xsl:template match=\"/\">\n"
862" <xsl:apply-templates select=\"greeting\"/>\n"
864" <xsl:template match=\"greeting\">\n"
868" <xsl:value-of select=\".\"/>\n"
878"</h1></body></html>";
881"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
882"<root xmlns:dt=\"urn:schemas-microsoft-com:datatypes\">\n"
883" <string>Wine</string>\n"
884" <string2 dt:dt=\"string\">String</string2>\n"
885" <number dt:dt=\"number\">12.44</number>\n"
886" <number2 dt:dt=\"NUMbEr\">-3.71e3</number2>\n"
887" <int dt:dt=\"int\">-13</int>\n"
888" <fixed dt:dt=\"fixed.14.4\">7322.9371</fixed>\n"
889" <bool dt:dt=\"boolean\">1</bool>\n"
890" <datetime dt:dt=\"datetime\">2009-11-18T03:21:33.12</datetime>\n"
891" <datetimetz dt:dt=\"datetime.tz\">2003-07-11T11:13:57+03:00</datetimetz>\n"
892" <date dt:dt=\"date\">3721-11-01</date>\n"
893" <time dt:dt=\"time\">13:57:12.31321</time>\n"
894" <timetz dt:dt=\"time.tz\">23:21:01.13+03:21</timetz>\n"
895" <i1 dt:dt=\"i1\">-13</i1>\n"
896" <i2 dt:dt=\"i2\">31915</i2>\n"
897" <i4 dt:dt=\"i4\">-312232</i4>\n"
898" <ui1 dt:dt=\"ui1\">123</ui1>\n"
899" <ui2 dt:dt=\"ui2\">48282</ui2>\n"
900" <ui4 dt:dt=\"ui4\">949281</ui4>\n"
901" <r4 dt:dt=\"r4\">213124.0</r4>\n"
902" <r8 dt:dt=\"r8\">0.412</r8>\n"
903" <float dt:dt=\"float\">41221.421</float>\n"
904" <uuid dt:dt=\"uuid\">333C7BC4-460F-11D0-BC04-0080C7055a83</uuid>\n"
905" <binhex dt:dt=\"bin.hex\">fffca012003c</binhex>\n"
906" <binbase64 dt:dt=\"bin.base64\">YmFzZTY0IHRlc3Q=</binbase64>\n"
907" <binbase64_1 dt:dt=\"bin.base64\">\nYmFzZTY0\nIHRlc3Q=\n</binbase64_1>\n"
908" <binbase64_2 dt:dt=\"bin.base64\">\nYmF\r\t z ZTY0\nIHRlc3Q=\n</binbase64_2>\n"
912"<?xml version=\"1.0\"?>"
913"<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" >"
914"<xsl:output method=\"html\"/>\n"
915"<xsl:template match=\"/\">"
917" <xsl:apply-templates select='document(\"";
921" <xsl:sort select=\"cost\"/><xsl:sort select=\"name\"/>"
922" </xsl:apply-templates>"
923"</TABLE></BODY></HTML>"
925"<xsl:template match=\"bottle\">"
926" <TR><xsl:apply-templates select=\"name\" /><xsl:apply-templates select=\"cost\" /></TR>"
928"<xsl:template match=\"name\">"
929" <TD><xsl:apply-templates /></TD>"
931"<xsl:template match=\"cost\">"
932" <TD><xsl:apply-templates /></TD>"
937"<?xml version=\"1.0\"?><bottle><wine><name>Wine</name><cost>$25.00</cost></wine></bottle>";
940"<HTML><BODY><TABLE><TD>Wine</TD><TD>$25.00</TD></TABLE></BODY></HTML>";
942#define SZ_EMAIL_DTD \
944" <!ELEMENT email (recipients,from,reply-to?,subject,body,attachment*)>"\
945" <!ATTLIST email attachments IDREFS #REQUIRED>"\
946" <!ATTLIST email sent (yes|no) \"no\">"\
947" <!ELEMENT recipients (to+,cc*)>"\
948" <!ELEMENT to (#PCDATA)>"\
949" <!ATTLIST to name CDATA #IMPLIED>"\
950" <!ELEMENT cc (#PCDATA)>"\
951" <!ATTLIST cc name CDATA #IMPLIED>"\
952" <!ELEMENT from (#PCDATA)>"\
953" <!ATTLIST from name CDATA #IMPLIED>"\
954" <!ELEMENT reply-to (#PCDATA)>"\
955" <!ATTLIST reply-to name CDATA #IMPLIED>"\
956" <!ELEMENT subject ANY>"\
957" <!ELEMENT body ANY>"\
958" <!ATTLIST body enc CDATA #FIXED \"UTF-8\">"\
959" <!ELEMENT attachment (#PCDATA)>"\
960" <!ATTLIST attachment id ID #REQUIRED>"\
964"<?xml version=\"1.0\"?>"
966"<email attachments=\"patch1\">"
968" <to>wine-patches@winehq.org</to>"
970" <from name=\"Anonymous\">user@localhost</from>"
971" <subject>msxml3/tests: DTD validation (try 87)</subject>"
973" It no longer causes spontaneous combustion..."
975" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
979"<?xml version=\"1.0\"?>"
981"<email attachments=\"patch1\">"
983" <to>wine-patches@winehq.org</to>"
985" <from name=\"Anonymous\">user@localhost</from>"
986" <subject>msxml3/tests: DTD validation (try 88)</subject>"
989" XML_ELEMENT_UNDECLARED 0xC00CE00D"
991" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
995"<?xml version=\"1.0\"?>"
997"<email attachments=\"patch1\">"
999" <to>wine-patches@winehq.org</to>"
1001" <from name=\"Anonymous\">user@localhost</from>"
1002" <subject>msxml3/tests: DTD validation (try 89)</subject>"
1004" XML_ELEMENT_ID_NOT_FOUND 0xC00CE00E"
1006" <attachment id=\"patch\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1010"<?xml version=\"1.0\"?>"
1012"<email attachments=\"patch1\">"
1015" <from name=\"Anonymous\">user@localhost</from>"
1016" <subject>msxml3/tests: DTD validation (try 90)</subject>"
1018" XML_EMPTY_NOT_ALLOWED 0xC00CE011"
1020" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1024"<?xml version=\"1.0\"?>"
1026"<msg attachments=\"patch1\">"
1028" <to>wine-patches@winehq.org</to>"
1030" <from name=\"Anonymous\">user@localhost</from>"
1031" <subject>msxml3/tests: DTD validation (try 91)</subject>"
1033" XML_ROOT_NAME_MISMATCH 0xC00CE013"
1035" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1039"<?xml version=\"1.0\"?>"
1041"<email attachments=\"patch1\">"
1042" <to>wine-patches@winehq.org</to>"
1043" <from name=\"Anonymous\">user@localhost</from>"
1044" <subject>msxml3/tests: DTD validation (try 92)</subject>"
1046" XML_INVALID_CONTENT 0xC00CE014"
1048" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1052"<?xml version=\"1.0\"?>"
1054"<email attachments=\"patch1\" ip=\"127.0.0.1\">"
1056" <to>wine-patches@winehq.org</to>"
1058" <from name=\"Anonymous\">user@localhost</from>"
1059" <subject>msxml3/tests: DTD validation (try 93)</subject>"
1061" XML_ATTRIBUTE_NOT_DEFINED 0xC00CE015"
1063" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1067"<?xml version=\"1.0\"?>"
1069"<email attachments=\"patch1\">"
1071" <to>wine-patches@winehq.org</to>"
1073" <from name=\"Anonymous\">user@localhost</from>"
1074" <subject>msxml3/tests: DTD validation (try 94)</subject>"
1075" <body enc=\"ASCII\">"
1076" XML_ATTRIBUTE_FIXED 0xC00CE016"
1078" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1082"<?xml version=\"1.0\"?>"
1084"<email attachments=\"patch1\" sent=\"true\">"
1086" <to>wine-patches@winehq.org</to>"
1088" <from name=\"Anonymous\">user@localhost</from>"
1089" <subject>msxml3/tests: DTD validation (try 95)</subject>"
1091" XML_ATTRIBUTE_VALUE 0xC00CE017"
1093" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1097"<?xml version=\"1.0\"?>"
1099"<email attachments=\"patch1\">"
1102" <to>wine-patches@winehq.org</to>"
1104" <from name=\"Anonymous\">user@localhost</from>"
1105" <subject>msxml3/tests: DTD validation (try 96)</subject>"
1107" XML_ILLEGAL_TEXT 0xC00CE018"
1109" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1113"<?xml version=\"1.0\"?>"
1117" <to>wine-patches@winehq.org</to>"
1119" <from name=\"Anonymous\">user@localhost</from>"
1120" <subject>msxml3/tests: DTD validation (try 97)</subject>"
1122" XML_REQUIRED_ATTRIBUTE_MISSING 0xC00CE020"
1124" <attachment id=\"patch1\">0001-msxml3-tests-DTD-validation.patch</attachment>"
1128"<?xml version=\"1.0\"?>"
1130" <a attr1=\"1\" attr2=\"2\" />"
1137 "<?xml version=\"1.0\"?>"
1138 "<a xmlns:ns=\"nshref\" xml:lang=\"ru\" ns:b=\"b attr\" xml:c=\"c attr\" "
1143 "<?xml version=\"1.0\"?>"
1144 "<a attr1=\"value1\" attr2=\"value2\" attr3=\"value3\" attr4=\"value4\" />"
1148 'c',
':',
'\\',
'N',
'o',
'n',
'e',
'x',
'i',
's',
't',
'e',
'n',
't',
'.',
'x',
'm',
'l', 0
1151 'n',
'o',
'n',
'E',
'x',
'i',
's',
'i',
't',
'i',
'n',
'g',
'A',
't',
't',
'r',
'i',
'b',
'u',
't',
'e',0
1154 '#',
'd',
'o',
'c',
'u',
'm',
'e',
'n',
't', 0
1168static const WCHAR szCommentXML[] = {
'<',
'!',
'-',
'-',
'A',
' ',
'C',
'o',
'm',
'm',
'e',
'n',
't',
'-',
'-',
'>',0 };
1172static const WCHAR szElementXML[] = {
'<',
'E',
'l',
'e',
'T',
'e',
's',
't',
'/',
'>',0 };
1173static const WCHAR szElementXML2[] = {
'<',
'E',
'l',
'e',
'T',
'e',
's',
't',
' ',
'A',
't',
't',
'r',
'=',
'"',
'"',
'/',
'>',0 };
1174static const WCHAR szElementXML3[] = {
'<',
'E',
'l',
'e',
'T',
'e',
's',
't',
' ',
'A',
't',
't',
'r',
'=',
'"',
'"',
'>',
1175 'T',
'e',
's',
't',
'i',
'n',
'g',
'N',
'o',
'd',
'e',
'<',
'/',
'E',
'l',
'e',
'T',
'e',
's',
't',
'>',0 };
1176static const WCHAR szElementXML4[] = {
'<',
'E',
'l',
'e',
'T',
'e',
's',
't',
' ',
'A',
't',
't',
'r',
'=',
'"',
'"',
'>',
1177 '&',
'a',
'm',
'p',
';',
'x',
' ',0x2103,
'<',
'/',
'E',
'l',
'e',
'T',
'e',
's',
't',
'>',0 };
1182static const WCHAR szCData[] = {
'[',
'1',
']',
'*',
'2',
'=',
'3',
';',
' ',
'&',
'g',
'e',
'e',
' ',
't',
'h',
'a',
't',
's',
1183 ' ',
'n',
'o',
't',
' ',
'r',
'i',
'g',
'h',
't',
'!', 0};
1184static const WCHAR szCDataXML[] = {
'<',
'!',
'[',
'C',
'D',
'A',
'T',
'A',
'[',
'[',
'1',
']',
'*',
'2',
'=',
'3',
';',
' ',
'&',
1185 'g',
'e',
'e',
' ',
't',
'h',
'a',
't',
's',
' ',
'n',
'o',
't',
' ',
'r',
'i',
'g',
'h',
't',
1187static const WCHAR szCDataNodeText[] = {
'#',
'c',
'd',
'a',
't',
'a',
'-',
's',
'e',
'c',
't',
'i',
'o',
'n',0 };
1188static const WCHAR szDocFragmentText[] = {
'#',
'd',
'o',
'c',
'u',
'm',
'e',
'n',
't',
'-',
'f',
'r',
'a',
'g',
'm',
'e',
'n',
't',0 };
1191static const WCHAR szEntityRefXML[] = {
'&',
'e',
'n',
't',
'i',
't',
'y',
'r',
'e',
'f',
';',0 };
1194#define expect_bstr_eq_and_free(bstr, expect) { \
1195 BSTR bstrExp = alloc_str_from_narrow(expect); \
1196 ok(lstrcmpW(bstr, bstrExp) == 0, "String differs\n"); \
1197 SysFreeString(bstr); \
1198 SysFreeString(bstrExp); \
1201#define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); }
1203#define ole_check(expr) { \
1205 ok(r == S_OK, #expr " returned %x\n", r); \
1208#define ole_expect(expr, expect) { \
1210 ok(r == (expect), #expr " returned %x, expected %x\n", r, expect); \
1213#define double_eq(x, y) ok((x)-(y)<=1e-14*(x) && (x)-(y)>=-1e-14*(x), "expected %.16g, got %.16g\n", x, y)
1221 ok(
hr ==
S_OK,
"failed to create %s instance: 0x%08x\n",
name,
hr);
1226#define _create(cls) cls, #cls
1228#define create_document(iid) _create_object(&_create(CLSID_DOMDocument2), iid, __LINE__)
1229#define create_document_version(v, iid) _create_object(&_create(CLSID_DOMDocument ## v), iid, __LINE__)
1230#define create_cache(iid) _create_object(&_create(CLSID_XMLSchemaCache), iid, __LINE__)
1231#define create_xsltemplate(iid) _create_object(&_create(CLSID_XSLTemplate), iid, __LINE__)
1271 while (*sLeft ==
'\r' || *sLeft ==
'\n') sLeft++;
1272 while (*sRight ==
'\r' || *sRight ==
'\n') sRight++;
1273 if (*sLeft != *sRight)
return FALSE;
1274 if (!*sLeft)
return TRUE;
1312 IXMLDOMNode_AddRef(
node);
1318 r = IXMLDOMNode_get_previousSibling(
node, &new_node);
1320 IXMLDOMNode_Release(
node);
1322 }
while (
r ==
S_OK);
1337 IXMLDOMNode_AddRef(
node);
1356 r = IXMLDOMNode_selectSingleNode(
node,
_bstr_(
".."), &new_node);
1360 r = IXMLDOMNode_get_parentNode(
node, &new_node);
1366 IXMLDOMNode_Release(
node);
1377 static char buf[4096];
1388 hr = IXMLDOMNodeList_get_length(
list, &
len);
1390 for (
i = 0;
i <
len;
i++)
1398 IXMLDOMNode_Release(
node);
1404#define expect_node(node, expstr) { char str[4096]; node_to_string(node, str); ok(strcmp(str, expstr)==0, "Invalid node: %s, expected %s\n", str, expstr); }
1405#define expect_list_and_release(list, expstr) { char *str = list_to_string(list); ok(strcmp(str, expstr)==0, "Invalid node list: %s, expected %s\n", str, expstr); if (list) IXMLDOMNodeList_Release(list); }
1420 { &CLSID_DOMDocument2,
"CLSID_DOMDocument2", {{VARIANT_FALSE,
S_FALSE }, {VARIANT_FALSE,
S_FALSE } }},
1421 { &CLSID_DOMDocument26,
"CLSID_DOMDocument26", {{VARIANT_FALSE,
S_FALSE }, {VARIANT_TRUE,
S_OK } }},
1422 { &CLSID_DOMDocument30,
"CLSID_DOMDocument30", {{VARIANT_FALSE,
S_FALSE }, {VARIANT_FALSE,
S_FALSE } }},
1423 { &CLSID_DOMDocument40,
"CLSID_DOMDocument40", {{VARIANT_FALSE,
S_FALSE }, {VARIANT_FALSE,
S_FALSE } }},
1424 { &CLSID_DOMDocument60,
"CLSID_DOMDocument60", {{VARIANT_FALSE,
S_FALSE }, {VARIANT_FALSE,
S_FALSE } }},
1429 "\n<?xml version=\"1.0\" encoding=\"UTF-16\" ?><root/>",
1430 " <?xml version=\"1.0\"?><root/>",
1431 "\n<?xml version=\"1.0\"?><root/>",
1432 "\t<?xml version=\"1.0\"?><root/>",
1433 "\r\n<?xml version=\"1.0\"?><root/>",
1434 "\r<?xml version=\"1.0\"?><root/>",
1435 "\r\r\r\r\t\t \n\n <?xml version=\"1.0\"?><root/>",
1452 const char **data_ptr;
1471 while (class_ptr->
clsid)
1503 hr = IXMLDOMDocument_load(doc,
var, &
b);
1505 ok(
b == class_ptr->
ret[0].b,
"%d:%d, got %d, expected %d\n",
index,
i,
b, class_ptr->
ret[0].b);
1510 hr = IXMLDOMDocument_loadXML(doc,
data, &
b);
1512 ok(
b == class_ptr->
ret[1].b,
"%d:%d, got %d, expected %d\n",
index,
i,
b, class_ptr->
ret[1].b);
1529 IXMLDOMDocument_loadXML( doc, (
BSTR)0x1,
NULL );
1533 hr = IXMLDOMDocument_loadXML( doc,
NULL,
NULL );
1537 hr = IXMLDOMDocument_loadXML( doc,
NULL, &
b );
1539 ok(
b == VARIANT_FALSE,
"failed to load XML string\n");
1548 r = IXMLDOMDocument_load( doc,
var, &
b);
1550 ok(
b == VARIANT_FALSE,
"succeeded in loading XML string\n");
1553 str = (
void *)0xdeadbeef;
1554 hr = IXMLDOMDocument_get_url(doc, &
str);
1561 r = IXMLDOMDocument_loadXML( doc,
str, &
b );
1563 ok(
b == VARIANT_FALSE,
"succeeded in loading XML string\n");
1566 r = IXMLDOMDocument_get_async( doc, &
b );
1567 ok(
r ==
S_OK,
"get_async failed (%08x)\n",
r);
1568 ok(
b == VARIANT_TRUE,
"Wrong default value\n");
1572 r = IXMLDOMDocument_get_documentElement( doc, &
element );
1573 ok(
r ==
S_FALSE,
"should be no document element\n");
1578 r = IXMLDOMDocument_selectSingleNode( doc,
str, &
node );
1584 r = IXMLDOMDocument_loadXML( doc,
str, &
b );
1586 ok(
b == VARIANT_FALSE,
"succeeded in loading XML string\n");
1591 r = IXMLDOMDocument_get_documentElement( doc, &
element );
1592 ok(
r ==
S_FALSE,
"should be no document element\n");
1600 r = IXMLDOMDocument_loadXML( doc, &
buff[2], &
b );
1601 ok(
r ==
S_OK,
"loadXML failed\n");
1602 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1607 r = IXMLDOMDocument_loadXML( doc,
str, &
b );
1608 ok(
r ==
S_OK,
"loadXML failed\n");
1609 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1615 r = IXMLDOMDocument_loadXML( doc,
str, &
b );
1617 ok(
b == VARIANT_FALSE,
"succeeded in loading XML string\n");
1623 r = IXMLDOMDocument_loadXML( doc,
str, &
b );
1624 ok(
r ==
S_OK,
"loadXML failed\n");
1625 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1629 r = IXMLDOMDocument_get_nodeName( doc,
NULL );
1632 str = (
void *)0xdeadbeef;
1633 r = IXMLDOMDocument_get_baseName( doc, &
str );
1639 r = IXMLDOMDocument_get_nodeName( doc, &
str );
1640 ok (
r ==
S_OK,
"get_nodeName wrong code\n");
1646 r = IXMLDOMDocument_put_text( doc,
_bstr_(
"Should fail") );
1651 r = IXMLDOMDocument_get_documentElement( doc, &
element );
1652 ok(
r ==
S_OK,
"should be a document element\n");
1657 r = IXMLDOMElement_QueryInterface(
element, &IID_IObjectIdentity, (
void**)&
ident );
1660 IXMLDOMElement_Release(
element );
1666 r = IXMLDOMDocument_loadXML( doc,
NULL,
NULL );
1668 ok(
b == 2,
"variant modified\n");
1669 r = IXMLDOMDocument_get_documentElement( doc, &
element );
1670 ok(
r ==
S_FALSE,
"should be no document element\n");
1675 r = IXMLDOMDocument_loadXML( doc,
str, &
b );
1676 ok(
r ==
S_OK,
"loadXML failed\n");
1677 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1683 ok(
r ==
S_OK,
"loadXML failed\n");
1684 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
1686 r = IXMLDOMDocument_get_parseError( doc, &
error );
1687 ok(
r ==
S_OK,
"returns %08x\n",
r );
1689 r = IXMLDOMParseError_get_errorCode(
error, &
code );
1692 IXMLDOMParseError_Release(
error );
1695 r = IXMLDOMDocument_createTextNode(doc,
_bstr_(
""), &nodetext);
1696 ok(
r ==
S_OK,
"returns %08x\n",
r );
1697 IXMLDOMText_Release(nodetext);
1700 r = IXMLDOMDocument_createTextNode(doc,
str,
NULL);
1702 r = IXMLDOMDocument_createTextNode(doc,
str, &nodetext);
1703 ok(
r ==
S_OK,
"returns %08x\n",
r );
1707 r = IXMLDOMText_QueryInterface(nodetext, &IID_IXMLDOMElement, (
void**)&
element);
1711 r = IXMLDOMText_get_lastChild(nodetext,
NULL);
1715 r = IXMLDOMText_get_lastChild(nodetext, &nodeChild);
1717 ok(nodeChild ==
NULL,
"nodeChild not NULL\n");
1720 r = IXMLDOMText_get_length(nodetext,
NULL);
1723 r = IXMLDOMText_get_length(nodetext, &
nLength);
1728 r = IXMLDOMText_put_data(nodetext,
_bstr_(
"This &is a ; test <>\\"));
1732 r = IXMLDOMText_get_data(nodetext, &
str);
1738 r = IXMLDOMText_get_xml(nodetext, &
str);
1740 ok( !
lstrcmpW(
str,
_bstr_(
"This &is a ; test <>\\") ),
"incorrect xml string\n");
1744 r = IXMLDOMText_get_text(nodetext, &
str);
1750 r = IXMLDOMText_substringData(nodetext, 0, 4,
NULL);
1754 str = (
void *)0xdeadbeef;
1755 r = IXMLDOMText_substringData(nodetext, -1, 4, &
str);
1760 str = (
void *)0xdeadbeef;
1761 r = IXMLDOMText_substringData(nodetext, 30, 0, &
str);
1766 str = (
void *)0xdeadbeef;
1767 r = IXMLDOMText_substringData(nodetext, 0, -1, &
str);
1772 str = (
void *)0xdeadbeef;
1773 r = IXMLDOMText_substringData(nodetext, 2, 0, &
str);
1778 r = IXMLDOMText_substringData(nodetext, 0, 4, &
str);
1784 r = IXMLDOMText_substringData(nodetext, 13, 4, &
str);
1790 r = IXMLDOMText_substringData(nodetext, 20, 4, &
str);
1796 r = IXMLDOMText_appendData(nodetext,
NULL);
1799 r = IXMLDOMText_appendData(nodetext,
_bstr_(
""));
1802 r = IXMLDOMText_appendData(nodetext,
_bstr_(
"Append"));
1805 r = IXMLDOMText_get_text(nodetext, &
str);
1812 r = IXMLDOMText_insertData(nodetext, -1,
str);
1815 r = IXMLDOMText_insertData(nodetext, -1,
NULL);
1818 r = IXMLDOMText_insertData(nodetext, 1000,
str);
1821 r = IXMLDOMText_insertData(nodetext, 1000,
NULL);
1824 r = IXMLDOMText_insertData(nodetext, 0,
NULL);
1827 r = IXMLDOMText_insertData(nodetext, 0,
str);
1831 r = IXMLDOMText_insertData(nodetext, -1,
_bstr_(
"Inserting"));
1834 r = IXMLDOMText_insertData(nodetext, 1000,
_bstr_(
"Inserting"));
1837 r = IXMLDOMText_insertData(nodetext, 0,
_bstr_(
"Begin "));
1840 r = IXMLDOMText_insertData(nodetext, 17,
_bstr_(
"Middle"));
1843 r = IXMLDOMText_insertData(nodetext, 39,
_bstr_(
" End"));
1846 r = IXMLDOMText_get_text(nodetext, &
str);
1853 r = IXMLDOMText_deleteData(nodetext, -1, 1);
1856 r = IXMLDOMText_deleteData(nodetext, 0, 0);
1859 r = IXMLDOMText_deleteData(nodetext, 0, -1);
1862 r = IXMLDOMText_get_length(nodetext, &
nLength);
1866 r = IXMLDOMText_deleteData(nodetext,
nLength, 1);
1869 r = IXMLDOMText_deleteData(nodetext,
nLength+1, 1);
1873 r = IXMLDOMText_deleteData(nodetext, 0, 5);
1876 r = IXMLDOMText_get_length(nodetext, &
nLength);
1880 r = IXMLDOMText_get_text(nodetext, &
str);
1886 r = IXMLDOMText_deleteData(nodetext, 35, 3);
1889 r = IXMLDOMText_get_length(nodetext, &
nLength);
1893 r = IXMLDOMText_get_text(nodetext, &
str);
1899 r = IXMLDOMText_deleteData(nodetext, 1, 33);
1902 r = IXMLDOMText_get_length(nodetext, &
nLength);
1906 r = IXMLDOMText_get_text(nodetext, &
str);
1912 r = IXMLDOMText_get_length(nodetext, &
nLength);
1915 r = IXMLDOMText_deleteData(nodetext, 0,
nLength);
1918 r = IXMLDOMText_deleteData(nodetext, 0,
nLength);
1924 r = IXMLDOMText_put_nodeValue(nodetext,
var);
1928 r = IXMLDOMText_get_text(nodetext, &
str);
1936 r = IXMLDOMText_put_nodeValue(nodetext,
var);
1940 r = IXMLDOMText_get_text(nodetext, &
str);
1948 r = IXMLDOMText_put_nodeValue(nodetext,
var);
1952 r = IXMLDOMText_replaceData(nodetext, 6, 0,
NULL);
1954 r = IXMLDOMText_get_text(nodetext, &
str);
1959 r = IXMLDOMText_replaceData(nodetext, 0, 0,
NULL);
1961 r = IXMLDOMText_get_text(nodetext, &
str);
1967 r = IXMLDOMText_replaceData(nodetext, 0, 1,
NULL);
1969 r = IXMLDOMText_get_text(nodetext, &
str);
1975 r = IXMLDOMText_replaceData(nodetext, 0, 1,
_bstr_(
""));
1977 r = IXMLDOMText_get_text(nodetext, &
str);
1983 r = IXMLDOMText_replaceData(nodetext, 0, 0,
_bstr_(
"a"));
1985 r = IXMLDOMText_get_text(nodetext, &
str);
1990 r = IXMLDOMText_replaceData(nodetext, 0, 2,
NULL);
1993 r = IXMLDOMText_insertData(nodetext, 0,
_bstr_(
"m"));
1995 r = IXMLDOMText_get_text(nodetext, &
str);
2001 r = IXMLDOMText_replaceData(nodetext, 0, 2,
_bstr_(
"a1.2"));
2003 r = IXMLDOMText_get_text(nodetext, &
str);
2009 r = IXMLDOMText_replaceData(nodetext, 0, 1,
_bstr_(
"wine"));
2011 r = IXMLDOMText_get_text(nodetext, &
str);
2016 IXMLDOMText_Release( nodetext );
2020 r = IXMLDOMDocument_createComment(doc,
NULL,
NULL);
2025 r = IXMLDOMDocument_createComment(doc,
_bstr_(
""), &node_comment);
2026 ok(
r ==
S_OK,
"returns %08x\n",
r );
2028 r = IXMLDOMComment_get_data(node_comment, &
str);
2029 ok(
r ==
S_OK,
"returns %08x\n",
r );
2031 IXMLDOMComment_Release(node_comment);
2034 r = IXMLDOMDocument_createComment(doc,
NULL, &node_comment);
2035 ok(
r ==
S_OK,
"returns %08x\n",
r );
2037 r = IXMLDOMComment_get_data(node_comment, &
str);
2038 ok(
r ==
S_OK,
"returns %08x\n",
r );
2040 IXMLDOMComment_Release(node_comment);
2044 r = IXMLDOMDocument_createComment(doc,
str, &node_comment);
2046 ok(
r ==
S_OK,
"returns %08x\n",
r );
2050 r = IXMLDOMComment_get_lastChild(node_comment,
NULL);
2054 r = IXMLDOMComment_get_lastChild(node_comment, &nodeChild);
2056 ok(nodeChild ==
NULL,
"pLastChild not NULL\n");
2059 str = (
void *)0xdeadbeef;
2060 r = IXMLDOMComment_get_baseName(node_comment, &
str);
2064 IXMLDOMComment_Release( node_comment );
2069 r = IXMLDOMDocument_createAttribute(doc,
NULL,
NULL);
2071 r = IXMLDOMDocument_createAttribute(doc,
str, &node_attr);
2072 ok(
r ==
S_OK,
"returns %08x\n",
r );
2073 IXMLDOMAttribute_Release( node_attr);
2078 r = IXMLDOMDocument_createProcessingInstruction(doc,
str,
str,
NULL);
2080 r = IXMLDOMDocument_createProcessingInstruction(doc,
NULL,
str, &nodePI);
2082 r = IXMLDOMDocument_createProcessingInstruction(doc,
str,
str, &nodePI);
2086 r = IXMLDOMDocument_createProcessingInstruction(doc,
_bstr_(
"xml"),
_bstr_(
"version=\"1.0\""), &nodePI);
2087 ok(
r ==
S_OK,
"returns %08x\n",
r );
2091 r = IXMLDOMProcessingInstruction_get_lastChild(nodePI,
NULL);
2095 r = IXMLDOMProcessingInstruction_get_lastChild(nodePI, &nodeChild);
2097 ok(nodeChild ==
NULL,
"nodeChild not NULL\n");
2100 r = IXMLDOMProcessingInstruction_get_nodeName(nodePI, &
str);
2107 r = IXMLDOMProcessingInstruction_get_baseName(nodePI, &
str);
2113 r = IXMLDOMProcessingInstruction_get_target(nodePI, &
str);
2119 r = IXMLDOMProcessingInstruction_get_data(nodePI, &
str);
2125 r = IXMLDOMProcessingInstruction_put_data(nodePI,
_bstr_(
"version=\"1.0\" encoding=\"UTF-8\""));
2131 r = IXMLDOMProcessingInstruction_put_nodeValue(nodePI,
var);
2136 r = IXMLDOMProcessingInstruction_get_nodeName(nodePI, &
str);
2141 IXMLDOMProcessingInstruction_Release(nodePI);
2144 ref = IXMLDOMDocument_Release( doc );
2165 hr = IPersistStreamInit_InitNew(streaminit);
2168 hr = IPersistStreamInit_GetSizeMax(streaminit, &
size);
2178 hr = IXMLDOMDocument_QueryInterface(doc, &
IID_IPersist, (
void **)&persist);
2181 hr = IPersistStreamInit_GetClassID(streaminit,
NULL);
2185 hr = IPersistStreamInit_GetClassID(streaminit, &
clsid);
2189 IPersistStream_Release(
stream);
2190 IPersistStreamInit_Release(streaminit);
2191 IXMLDOMDocument_Release(doc);
2213 ok(
r ==
S_OK,
"loadXML failed\n");
2214 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
2218 r = IXMLDOMDocument_get_documentElement( doc, &
element );
2219 ok(
r ==
S_OK,
"should be a document element\n");
2225 r = IXMLDOMDocument_get_nodeValue( doc,
NULL );
2228 r = IXMLDOMDocument_get_nodeValue( doc, &
var );
2229 ok(
r ==
S_FALSE,
"nextNode returned wrong code\n");
2236 r = IXMLDOMElement_get_ownerDocument(
element, &owner );
2237 ok(
r ==
S_OK,
"get_ownerDocument return code\n");
2238 ok( owner != doc,
"get_ownerDocument return\n");
2239 IXMLDOMDocument_Release(owner);
2248 ok(
r ==
S_OK,
"get_baseName returned wrong code\n");
2259 ok (
r ==
S_OK,
"get_nodeName wrong code\n");
2268 ok(
r ==
E_FAIL,
"getAttribute ret %08x\n",
r );
2277 ok(
r ==
S_OK,
"getAttribute ret %08x\n",
r );
2290 ok(
r ==
S_OK,
"GetAttributeNode ret %08x\n",
r );
2291 ok(
attr !=
NULL,
"getAttributeNode returned NULL\n" );
2294 r = IXMLDOMAttribute_get_parentNode(
attr,
NULL );
2299 r = IXMLDOMAttribute_get_parentNode(
attr, &
node );
2300 ok(
r ==
S_FALSE,
"Expected S_FALSE, ret %08x\n",
r );
2303 IXMLDOMAttribute_Release(
attr);
2308 r = IXMLDOMElement_get_attributes(
element, &
map );
2309 ok(
r ==
S_OK,
"get_attributes returned wrong code\n");
2310 ok(
map !=
NULL,
"should be attributes\n");
2320 r = IXMLDOMNamedNodeMap_getNamedItem(
map,
str, &
node );
2321 ok(
r ==
S_OK,
"getNamedItem returned wrong code\n");
2323 IXMLDOMNode_Release(
node);
2327 r = IXMLDOMNamedNodeMap_getNamedItem(
map,
str,
NULL );
2334 r = IXMLDOMNamedNodeMap_getNamedItem(
map,
str, &
node );
2335 ok(
r ==
S_FALSE,
"getNamedItem found a node that wasn't there\n");
2336 ok(
node ==
NULL,
"getNamedItem should have returned NULL\n");
2340 r = IXMLDOMNamedNodeMap_get_length(
map,
NULL );
2343 r = IXMLDOMNamedNodeMap_get_length(
map, &
count );
2344 ok (
r ==
S_OK,
"get_length wrong code\n");
2345 ok (
count == 1,
"get_length != 1\n");
2348 r = IXMLDOMNamedNodeMap_get_item(
map, -1, &
node);
2349 ok (
r ==
S_FALSE,
"get_item (-1) wrong code\n");
2353 r = IXMLDOMNamedNodeMap_get_item(
map, 1, &
node);
2354 ok (
r ==
S_FALSE,
"get_item (1) wrong code\n");
2355 ok (
node ==
NULL,
"there is no attribute\n");
2358 r = IXMLDOMNamedNodeMap_get_item(
map, 0, &
node);
2359 ok (
r ==
S_OK,
"get_item (0) wrong code\n");
2362 r = IXMLDOMNode_get_nodeName(
node,
NULL );
2367 r = IXMLDOMNode_get_nodeName(
node, &
str );
2368 ok (
r ==
S_OK,
"get_nodeName wrong code\n");
2372 IXMLDOMNode_Release(
node );
2376 r = IXMLDOMNamedNodeMap_nextNode(
map, &
node );
2377 ok (
r ==
S_OK,
"nextNode (first time) wrong code\n");
2378 ok (
node !=
NULL,
"nextNode, should be attribute\n");
2379 IXMLDOMNode_Release(
node );
2381 r = IXMLDOMNamedNodeMap_nextNode(
map, &
node );
2382 ok (
r !=
S_OK,
"nextNode (second time) wrong code\n");
2383 ok (
node ==
NULL,
"nextNode, there is no attribute\n");
2385 r = IXMLDOMNamedNodeMap_reset(
map );
2386 ok (
r ==
S_OK,
"reset should return S_OK\n");
2388 r = IXMLDOMNamedNodeMap_nextNode(
map, &
node );
2389 ok (
r ==
S_OK,
"nextNode (third time) wrong code\n");
2390 ok (
node !=
NULL,
"nextNode, should be attribute\n");
2398 r = IXMLDOMNode_get_nodeType(
node, &
type);
2399 ok(
r ==
S_OK,
"getNamedItem returned wrong code\n");
2403 r = IXMLDOMNode_get_baseName(
node,
NULL );
2407 r = IXMLDOMNode_get_baseName(
node, &
str );
2408 ok(
r ==
S_OK,
"get_baseName returned wrong code\n");
2412 r = IXMLDOMNode_get_childNodes(
node,
NULL );
2415 r = IXMLDOMNode_get_childNodes(
node, &
list );
2416 ok(
r ==
S_OK,
"get_childNodes returned wrong code\n");
2420 r = IXMLDOMNodeList_nextNode(
list, &
next );
2421 ok(
r ==
S_OK,
"nextNode returned wrong code\n");
2431 r = IXMLDOMNode_get_nodeType(
next, &
type);
2432 ok(
r ==
S_OK,
"getNamedItem returned wrong code\n");
2435 str = (
void *)0xdeadbeef;
2436 r = IXMLDOMNode_get_baseName(
next, &
str );
2437 ok(
r ==
S_FALSE,
"get_baseName returned wrong code\n");
2438 ok(
str ==
NULL,
"basename was wrong\n");
2445 IXMLDOMNode_Release(
next );
2448 IXMLDOMNodeList_Release(
list );
2451 IXMLDOMNode_Release(
node );
2458 IXMLDOMNamedNodeMap_Release(
map );
2464 ok(
r ==
S_OK,
"get_childNodes returned wrong code\n");
2469 IXMLDOMNode_Release(
node);
2472 IXMLDOMNode_Release(
node);
2475 IXMLDOMNodeList_AddRef(
list);
2479 node = (
void*)0xdeadbeef;
2490 r = IXMLDOMNode_Release(
node );
2491 ok(
r == 0,
"ret %08x\n",
r );
2498 r = IXMLDOMNodeList_get_item(
list, 0,
NULL);
2501 r = IXMLDOMNodeList_get_length(
list,
NULL);
2504 r = IXMLDOMNodeList_get_length(
list, &
count );
2505 ok(
r ==
S_OK,
"get_length returns %08x\n",
r );
2508 r = IXMLDOMNodeList_nextNode(
list,
NULL);
2511 r = IXMLDOMNodeList_nextNode(
list, &
node );
2512 ok(
r ==
S_OK,
"nextNode returned wrong code\n");
2520 r = IXMLDOMNode_get_nodeType(
node, &
type);
2521 ok(
r ==
S_OK,
"getNamedItem returned wrong code\n");
2524 r = IXMLDOMNode_hasChildNodes(
node,
NULL );
2530 r = IXMLDOMNode_get_baseName(
node, &
str );
2531 ok(
r ==
S_OK,
"get_baseName returned wrong code\n");
2539 IXMLDOMNode_Release(
node );
2541 IXMLDOMNodeList_Release(
list );
2543 IXMLDOMElement_Release(
element );
2547 r = IXMLDOMDocument_loadXML( doc,
str, &
b );
2548 ok(
r ==
S_OK,
"loadXML failed\n");
2549 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
2554 r = IXMLDOMDocument_get_documentElement( doc, &
element );
2555 ok(
r ==
S_OK,
"should be a document element\n");
2560 static const WCHAR szSSearch[] = {
'S',
':',
's',
'e',
'a',
'r',
'c',
'h',0};
2565 ok(
r ==
S_OK,
"couldn't get tag name\n");
2570 IXMLDOMElement_Release(
element );
2572 ok(IXMLDOMDocument_Release( doc ) == 0,
"document is not destroyed\n");
2612 IUnknown *node_typed, *node_typed2;
2644 todo_wine ok(disp != disp2,
"%d: got %p and %p\n",
ptr->type, disp, disp2);
2648 IDispatch_Release(disp);
2649 IDispatch_Release(disp2);
2653 hr = IUnknown_QueryInterface(unk, &IID_IXMLDOMNode, (
void**)&node2);
2660 hr = IUnknown_QueryInterface(unk, &IID_IXMLDOMNode, (
void**)&node3);
2662 todo_wine ok(node2 != node3,
"%d: got %p and %p\n",
ptr->type, node2, node3);
2666 IXMLDOMNode_Release(node2);
2667 IXMLDOMNode_Release(node3);
2671 hr = IUnknown_QueryInterface(unk, &IID_IDispatchEx, (
void**)&dispex);
2673 ok(unk != (
IUnknown*)dispex,
"%d: got %p and %p\n",
ptr->type, unk, dispex);
2678 hr = IUnknown_QueryInterface(unk, &IID_IDispatchEx, (
void**)&dispex2);
2680 todo_wine ok(dispex != dispex2,
"%d: got %p and %p\n",
ptr->type, dispex, dispex2);
2684 IDispatchEx_Release(dispex);
2685 IDispatchEx_Release(dispex2);
2689 hr = IUnknown_QueryInterface(unk,
ptr->iid, (
void**)&node_typed);
2692 hr = IUnknown_QueryInterface(unk,
ptr->iid, (
void**)&node_typed2);
2695 todo_wine ok(node_typed != node_typed2,
"%d: got %p and %p\n",
ptr->type, node_typed, node_typed2);
2696 IUnknown_Release(node_typed);
2697 IUnknown_Release(node_typed2);
2700 hr = IUnknown_QueryInterface(unk, (
ptr+1)->iid, (
void**)&node_typed);
2703 IUnknown_Release(unk);
2706 hr = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMNode, (
void**)&node2);
2709 ok(
node == node2,
"%d: got %p and %p\n",
ptr->type,
node, node2);
2712 hr = IXMLDOMNode_QueryInterface(
node,
ptr->iid, (
void**)&node_typed);
2719 IUnknown_Release(node_typed);
2721 IXMLDOMNode_Release(node2);
2722 IXMLDOMNode_Release(
node);
2728 ref = IXMLDOMDocument_Release(doc);
2734 hr = IXMLDOMDocument_QueryInterface(doc, &
IID_IUnknown, (
void**)&unk);
2740 IXMLDOMDocument_Release(doc);
2742 IUnknown_Release(unk);
2747 hr = IXMLDOMDocument_QueryInterface(doc, &
IID_IUnknown, (
void**)&unk);
2753 IUnknown_Release(unk);
2757 hr = IXMLDOMDocument_get_implementation(doc, &impl);
2761 hr = IXMLDOMDocument_get_implementation(doc, &impl2);
2765 ok(impl != impl2,
"got %p, %p\n", impl, impl2);
2766 IXMLDOMImplementation_Release(impl);
2767 IXMLDOMImplementation_Release(impl2);
2771 ok(
b == VARIANT_TRUE,
"failed to load XML string\n");
2774 IXMLDOMDocument_AddRef( doc );
2776 IXMLDOMDocument_AddRef( doc );
2779 IXMLDOMDocument_Release( doc );
2780 IXMLDOMDocument_Release( doc );
2783 hr = IXMLDOMDocument_QueryInterface(doc, &
IID_IUnknown, (
void**)&unk);
2789 hr = IXMLDOMDocument_get_documentElement(doc, &
element);
2795 hr = IXMLDOMDocument_get_documentElement(doc, &elem2);
2803 IXMLDOMElement_AddRef(
element);
2805 IXMLDOMElement_Release(
element);
2815 hr = IXMLDOMElement_QueryInterface(elem2, &
IID_IUnknown, (
void**)&unk2);
2824 todo_wine ok(unk == unk2,
"got %p and %p\n", unk, unk2);
2825 IUnknown_Release(unk);
2829 IXMLDOMElement_AddRef(elem2);
2831 IXMLDOMElement_Release(elem2);
2833 IXMLDOMElement_Release(elem2);
2836 IUnknown_Release(unk2);
2838 hr = IXMLDOMElement_get_childNodes(
element, &node_list );
2844 hr = IXMLDOMNodeList_get_item( node_list, 0, &
node );
2849 hr = IXMLDOMNodeList_get_item( node_list, 0, &node2 );
2854 ref = IXMLDOMNode_Release(
node );
2856 ref = IXMLDOMNode_Release( node2 );
2859 ref = IXMLDOMNodeList_Release( node_list );
2862 ok(
node != node2,
"node %p node2 %p\n",
node, node2 );
2864 ref = IXMLDOMDocument_Release( doc );
2873 hr = IXMLDOMElement_QueryInterface(
element, &IID_IXMLDOMNode, (
void**)&
node);
2879 ok(unk == unk2,
"unk %p unk2 %p\n", unk, unk2);
2882 IUnknown_Release( unk2 );
2883 IUnknown_Release( unk );
2884 IXMLDOMNode_Release(
node );
2887 IXMLDOMElement_Release(
element );
2894 static const WCHAR szOne[] = {
'1',0};
2895 static const WCHAR szOneGarbage[] = {
'1',
'G',
'a',
'r',
'b',
'a',
'g',
'e',0};
2920 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
2927 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
2934 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
2941 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
2948 ok(
r ==
S_OK,
"returns %08x\n",
r );
2951 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMComment, (
void**)&
comment);
2952 ok(
r ==
S_OK,
"returns %08x\n",
r );
2953 IXMLDOMNode_Release(
node);
2957 ok(
r ==
S_OK,
"returns %08x\n",
r );
2959 IXMLDOMComment_Release(
comment);
2964 ok(
r ==
S_OK,
"returns %08x\n",
r );
2966 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMComment, (
void**)&
comment);
2967 ok(
r ==
S_OK,
"returns %08x\n",
r );
2968 IXMLDOMNode_Release(
node);
2972 ok(
r ==
S_OK,
"returns %08x\n",
r );
2974 IXMLDOMComment_Release(
comment);
2979 ok(
r ==
S_OK,
"returns %08x\n",
r );
2981 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMComment, (
void**)&
comment);
2982 ok(
r ==
S_OK,
"returns %08x\n",
r );
2983 IXMLDOMNode_Release(
node);
2987 ok(
r ==
S_OK,
"returns %08x\n",
r );
2989 IXMLDOMComment_Release(
comment);
2997 ok(
r ==
S_OK,
"returns %08x\n",
r );
3000 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMText, (
void**)&
text);
3001 ok(
r ==
S_OK,
"returns %08x\n",
r );
3002 IXMLDOMNode_Release(
node);
3005 r = IXMLDOMText_get_data(
text, &
str);
3006 ok(
r ==
S_OK,
"returns %08x\n",
r );
3008 IXMLDOMText_Release(
text);
3013 ok(
r ==
S_OK,
"returns %08x\n",
r );
3015 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMText, (
void**)&
text);
3016 ok(
r ==
S_OK,
"returns %08x\n",
r );
3017 IXMLDOMNode_Release(
node);
3020 r = IXMLDOMText_get_data(
text, &
str);
3021 ok(
r ==
S_OK,
"returns %08x\n",
r );
3023 IXMLDOMText_Release(
text);
3028 ok(
r ==
S_OK,
"returns %08x\n",
r );
3030 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMText, (
void**)&
text);
3031 ok(
r ==
S_OK,
"returns %08x\n",
r );
3032 IXMLDOMNode_Release(
node);
3035 r = IXMLDOMText_get_data(
text, &
str);
3036 ok(
r ==
S_OK,
"returns %08x\n",
r );
3038 IXMLDOMText_Release(
text);
3046 ok(
r ==
S_OK,
"returns %08x\n",
r );
3049 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMCDATASection, (
void**)&cdata);
3050 ok(
r ==
S_OK,
"returns %08x\n",
r );
3051 IXMLDOMNode_Release(
node);
3054 r = IXMLDOMCDATASection_get_data(cdata, &
str);
3055 ok(
r ==
S_OK,
"returns %08x\n",
r );
3057 IXMLDOMCDATASection_Release(cdata);
3062 ok(
r ==
S_OK,
"returns %08x\n",
r );
3064 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMCDATASection, (
void**)&cdata);
3065 ok(
r ==
S_OK,
"returns %08x\n",
r );
3066 IXMLDOMNode_Release(
node);
3069 r = IXMLDOMCDATASection_get_data(cdata, &
str);
3070 ok(
r ==
S_OK,
"returns %08x\n",
r );
3072 IXMLDOMCDATASection_Release(cdata);
3077 ok(
r ==
S_OK,
"returns %08x\n",
r );
3079 r = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMCDATASection, (
void**)&cdata);
3080 ok(
r ==
S_OK,
"returns %08x\n",
r );
3081 IXMLDOMNode_Release(
node);
3084 r = IXMLDOMCDATASection_get_data(cdata, &
str);
3085 ok(
r ==
S_OK,
"returns %08x\n",
r );
3087 IXMLDOMCDATASection_Release(cdata);
3096 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3103 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3109 ok(
r ==
S_OK,
"returns %08x\n",
r );
3121 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3130 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3137 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3150 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3157 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3165 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3172 ok(
node == (
void*)0x1,
"expected same ptr, got %p\n",
node);
3178 ok(
r ==
S_OK,
"returns %08x\n",
r );
3189 ok(
r ==
S_OK,
"returns %08x\n",
r );
3195 ok(
r ==
S_OK,
"returns %08x\n",
r );
3209 ok(
r ==
S_OK,
"returns %08x\n",
r );
3212 r = IXMLDOMDocument_appendChild( doc,
node, &
root );
3213 ok(
r ==
S_OK,
"returns %08x\n",
r );
3219 ref = IXMLDOMNode_Release(
node );
3227 ok(
r ==
S_OK,
"returns %08x\n",
r );
3233 ok(
r ==
S_OK,
"returns %08x\n",
r );
3240 ok(
r ==
S_OK,
"returns %08x\n",
r );
3245 IXMLDOMNode_Release(
child );
3246 IUnknown_Release( unk );
3251 ok(
r ==
S_OK,
"returns %08x\n",
r );
3253 IXMLDOMNode_Release(
child );
3258 ok(
r ==
S_OK,
"returns %08x\n",
r );
3259 IXMLDOMNode_Release(
node );
3261 r = IXMLDOMNode_QueryInterface(
root, &IID_IXMLDOMElement, (
void**)&
element );
3262 ok(
r ==
S_OK,
"returns %08x\n",
r );
3264 r = IXMLDOMElement_get_attributes(
element, &attr_map );
3265 ok(
r ==
S_OK,
"returns %08x\n",
r );
3266 r = IXMLDOMNamedNodeMap_get_length( attr_map, &
num );
3267 ok(
r ==
S_OK,
"returns %08x\n",
r );
3269 IXMLDOMNamedNodeMap_Release( attr_map );
3275 ok(
r ==
S_OK,
"returns %08x\n",
r );
3276 r = IXMLDOMElement_get_attributes(
element, &attr_map );
3277 ok(
r ==
S_OK,
"returns %08x\n",
r );
3278 r = IXMLDOMNamedNodeMap_get_length( attr_map, &
num );
3279 ok(
r ==
S_OK,
"returns %08x\n",
r );
3281 IXMLDOMNamedNodeMap_Release( attr_map );
3287 ok(
r ==
S_OK,
"returns %08x\n",
r );
3288 r = IXMLDOMElement_get_attributes(
element, &attr_map );
3289 ok(
r ==
S_OK,
"returns %08x\n",
r );
3290 r = IXMLDOMNamedNodeMap_get_length( attr_map, &
num );
3291 ok(
r ==
S_OK,
"returns %08x\n",
r );
3293 IXMLDOMNamedNodeMap_Release( attr_map );
3296 ok(
r ==
S_OK,
"returns %08x\n",
r );
3305 ok(
r ==
S_OK,
"returns %08x\n",
r );
3306 r = IXMLDOMElement_get_attributes(
element, &attr_map );
3307 ok(
r ==
S_OK,
"returns %08x\n",
r );
3308 r = IXMLDOMNamedNodeMap_get_length( attr_map, &
num );
3309 ok(
r ==
S_OK,
"returns %08x\n",
r );
3311 IXMLDOMNamedNodeMap_Release( attr_map );
3319 ok(
r ==
S_OK,
"returns %08x\n",
r );
3322 ok(
r ==
S_OK,
"returns %08x\n"