msxml3: Dump namespace aliases passed with SelectionNamespaces property.
This commit is contained in:
parent
fd35084294
commit
2a5b375580
|
@ -58,10 +58,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
|
||||||
#define XML_SAVE_AS_XML 32
|
#define XML_SAVE_AS_XML 32
|
||||||
#define XML_SAVE_AS_HTML 64
|
#define XML_SAVE_AS_HTML 64
|
||||||
|
|
||||||
static const WCHAR SZ_PROPERTY_SELECTION_LANGUAGE[] = {'S','e','l','e','c','t','i','o','n','L','a','n','g','u','a','g','e',0};
|
static const WCHAR PropertySelectionLanguageW[] = {'S','e','l','e','c','t','i','o','n','L','a','n','g','u','a','g','e',0};
|
||||||
static const WCHAR SZ_PROPERTY_PROHIBIT_DTD[] = {'P','r','o','h','i','b','i','t','D','T','D',0};
|
static const WCHAR PropertySelectionNamespacesW[] = {'S','e','l','e','c','t','i','o','n','N','a','m','e','s','p','a','c','e','s',0};
|
||||||
static const WCHAR SZ_VALUE_XPATH[] = {'X','P','a','t','h',0};
|
static const WCHAR PropertyProhibitDTDW[] = {'P','r','o','h','i','b','i','t','D','T','D',0};
|
||||||
static const WCHAR SZ_VALUE_XSLPATTERN[] = {'X','S','L','P','a','t','t','e','r','n',0};
|
static const WCHAR PropValueXPathW[] = {'X','P','a','t','h',0};
|
||||||
|
static const WCHAR PropValueXSLPatternW[] = {'X','S','L','P','a','t','t','e','r','n',0};
|
||||||
|
|
||||||
typedef struct _domdoc
|
typedef struct _domdoc
|
||||||
{
|
{
|
||||||
|
@ -1736,9 +1737,9 @@ static HRESULT WINAPI domdoc_loadXML(
|
||||||
{
|
{
|
||||||
domdoc *This = impl_from_IXMLDOMDocument3( iface );
|
domdoc *This = impl_from_IXMLDOMDocument3( iface );
|
||||||
xmlDocPtr xmldoc = NULL;
|
xmlDocPtr xmldoc = NULL;
|
||||||
|
HRESULT hr = S_FALSE, hr2;
|
||||||
char *str;
|
char *str;
|
||||||
int len;
|
int len;
|
||||||
HRESULT hr = S_FALSE, hr2;
|
|
||||||
|
|
||||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w( bstrXML ), isSuccessful );
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w( bstrXML ), isSuccessful );
|
||||||
|
|
||||||
|
@ -1758,6 +1759,7 @@ static HRESULT WINAPI domdoc_loadXML(
|
||||||
{
|
{
|
||||||
hr = This->error = S_OK;
|
hr = This->error = S_OK;
|
||||||
*isSuccessful = VARIANT_TRUE;
|
*isSuccessful = VARIANT_TRUE;
|
||||||
|
TRACE("parsed document %p\n", xmldoc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2043,7 +2045,7 @@ static HRESULT WINAPI domdoc_setProperty(
|
||||||
|
|
||||||
TRACE("(%p)->(%s)\n", This, debugstr_w(p));
|
TRACE("(%p)->(%s)\n", This, debugstr_w(p));
|
||||||
|
|
||||||
if (lstrcmpiW(p, SZ_PROPERTY_SELECTION_LANGUAGE) == 0)
|
if (lstrcmpiW(p, PropertySelectionLanguageW) == 0)
|
||||||
{
|
{
|
||||||
VARIANT varStr;
|
VARIANT varStr;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -2060,9 +2062,9 @@ static HRESULT WINAPI domdoc_setProperty(
|
||||||
bstr = V_BSTR(&var);
|
bstr = V_BSTR(&var);
|
||||||
|
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
if (lstrcmpiW(bstr, SZ_VALUE_XPATH) == 0)
|
if (lstrcmpiW(bstr, PropValueXPathW) == 0)
|
||||||
This->bUseXPath = TRUE;
|
This->bUseXPath = TRUE;
|
||||||
else if (lstrcmpiW(bstr, SZ_VALUE_XSLPATTERN) == 0)
|
else if (lstrcmpiW(bstr, PropValueXSLPatternW) == 0)
|
||||||
This->bUseXPath = FALSE;
|
This->bUseXPath = FALSE;
|
||||||
else
|
else
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
|
@ -2070,12 +2072,18 @@ static HRESULT WINAPI domdoc_setProperty(
|
||||||
VariantClear(&varStr);
|
VariantClear(&varStr);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
else if (lstrcmpiW(p, SZ_PROPERTY_PROHIBIT_DTD) == 0)
|
else if (lstrcmpiW(p, PropertyProhibitDTDW) == 0)
|
||||||
{
|
{
|
||||||
/* Ignore */
|
/* Ignore */
|
||||||
FIXME("Ignoring property ProhibitDTD, value %d\n", V_BOOL(&var));
|
FIXME("Ignoring property ProhibitDTD, value %d\n", V_BOOL(&var));
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
else if (lstrcmpiW(p, PropertySelectionNamespacesW) == 0)
|
||||||
|
{
|
||||||
|
if (V_VT(&var) == VT_BSTR)
|
||||||
|
FIXME("Unsupported SelectionNamespaces: %s\n", wine_dbgstr_w(V_BSTR(&var)));
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
FIXME("Unknown property %s\n", wine_dbgstr_w(p));
|
FIXME("Unknown property %s\n", wine_dbgstr_w(p));
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
@ -2092,13 +2100,14 @@ static HRESULT WINAPI domdoc_getProperty(
|
||||||
|
|
||||||
if (var == NULL)
|
if (var == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
if (lstrcmpiW(p, SZ_PROPERTY_SELECTION_LANGUAGE) == 0)
|
|
||||||
|
if (lstrcmpiW(p, PropertySelectionLanguageW) == 0)
|
||||||
{
|
{
|
||||||
V_VT(var) = VT_BSTR;
|
V_VT(var) = VT_BSTR;
|
||||||
if (This->bUseXPath)
|
if (This->bUseXPath)
|
||||||
V_BSTR(var) = SysAllocString(SZ_VALUE_XPATH);
|
V_BSTR(var) = SysAllocString(PropValueXPathW);
|
||||||
else
|
else
|
||||||
V_BSTR(var) = SysAllocString(SZ_VALUE_XSLPATTERN);
|
V_BSTR(var) = SysAllocString(PropValueXSLPatternW);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2868,14 +2868,15 @@ static void test_XMLHTTP(void)
|
||||||
|
|
||||||
static void test_IXMLDOMDocument2(void)
|
static void test_IXMLDOMDocument2(void)
|
||||||
{
|
{
|
||||||
HRESULT r;
|
static const WCHAR emptyW[] = {0};
|
||||||
VARIANT_BOOL b;
|
|
||||||
BSTR str;
|
|
||||||
IXMLDOMDocument *doc;
|
|
||||||
IXMLDOMDocument2 *doc2;
|
IXMLDOMDocument2 *doc2;
|
||||||
|
IXMLDOMDocument *doc;
|
||||||
IDispatchEx *dispex;
|
IDispatchEx *dispex;
|
||||||
|
VARIANT_BOOL b;
|
||||||
VARIANT var;
|
VARIANT var;
|
||||||
int ref;
|
HRESULT r;
|
||||||
|
LONG ref;
|
||||||
|
BSTR str;
|
||||||
|
|
||||||
r = CoCreateInstance( &CLSID_DOMDocument, NULL,
|
r = CoCreateInstance( &CLSID_DOMDocument, NULL,
|
||||||
CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc );
|
CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc );
|
||||||
|
@ -2928,6 +2929,17 @@ static void test_IXMLDOMDocument2(void)
|
||||||
ole_check(IXMLDOMDocument2_setProperty(doc2, _bstr_("SelectionLanguage"), _variantbstr_("XPath")));
|
ole_check(IXMLDOMDocument2_setProperty(doc2, _bstr_("SelectionLanguage"), _variantbstr_("XPath")));
|
||||||
ole_check(IXMLDOMDocument2_setProperty(doc2, _bstr_("SelectionLanguage"), _variantbstr_("XSLPattern")));
|
ole_check(IXMLDOMDocument2_setProperty(doc2, _bstr_("SelectionLanguage"), _variantbstr_("XSLPattern")));
|
||||||
|
|
||||||
|
V_VT(&var) = VT_BSTR;
|
||||||
|
V_BSTR(&var) = SysAllocString(emptyW);
|
||||||
|
r = IXMLDOMDocument2_setProperty(doc2, _bstr_("SelectionNamespaces"), var);
|
||||||
|
todo_wine ok(r == S_OK, "got 0x%08x\n", r);
|
||||||
|
VariantClear(&var);
|
||||||
|
|
||||||
|
V_VT(&var) = VT_I2;
|
||||||
|
V_I2(&var) = 0;
|
||||||
|
r = IXMLDOMDocument2_setProperty(doc2, _bstr_("SelectionNamespaces"), var);
|
||||||
|
ok(r == E_FAIL, "got 0x%08x\n", r);
|
||||||
|
|
||||||
/* contrary to what MSDN claims you can switch back from XPath to XSLPattern */
|
/* contrary to what MSDN claims you can switch back from XPath to XSLPattern */
|
||||||
ole_check(IXMLDOMDocument2_getProperty(doc2, _bstr_("SelectionLanguage"), &var));
|
ole_check(IXMLDOMDocument2_getProperty(doc2, _bstr_("SelectionLanguage"), &var));
|
||||||
expect_eq(V_VT(&var), VT_BSTR, int, "%x");
|
expect_eq(V_VT(&var), VT_BSTR, int, "%x");
|
||||||
|
|
Loading…
Reference in New Issue