From: Alex Henrie alexhenrie24@gmail.com
--- dlls/msxml3/attribute.c | 3 +- dlls/msxml3/cdata.c | 8 +- dlls/msxml3/comment.c | 7 +- dlls/msxml3/docfrag.c | 8 +- dlls/msxml3/domdoc.c | 60 ++++------- dlls/msxml3/domimpl.c | 8 +- dlls/msxml3/element.c | 6 +- dlls/msxml3/entityref.c | 3 +- dlls/msxml3/httprequest.c | 44 ++++---- dlls/msxml3/mxnamespace.c | 12 +-- dlls/msxml3/mxwriter.c | 68 +++++-------- dlls/msxml3/pi.c | 16 +-- dlls/msxml3/saxreader.c | 130 +++++------------------- dlls/msxml3/schema.c | 207 +++++++++----------------------------- dlls/msxml3/text.c | 7 +- dlls/msxml3/xmlelem.c | 3 +- dlls/msxml3/xmlview.c | 31 ++---- 17 files changed, 167 insertions(+), 454 deletions(-)
diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 0cbba93c53a..a183a504e66 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -377,11 +377,10 @@ static HRESULT WINAPI domattr_get_nodeTypeString( BSTR* p) { domattr *This = impl_from_IXMLDOMAttribute( iface ); - static const WCHAR attributeW[] = {'a','t','t','r','i','b','u','t','e',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(attributeW, p); + return return_bstr(L"attribute", p); }
static HRESULT WINAPI domattr_get_text( diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index 3ed530b98d8..cab35e6c5c8 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -158,12 +158,9 @@ static HRESULT WINAPI domcdata_get_nodeName( { domcdata *This = impl_from_IXMLDOMCDATASection( iface );
- static const WCHAR cdata_sectionW[] = - {'#','c','d','a','t','a','-','s','e','c','t','i','o','n',0}; - TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(cdata_sectionW, p); + return return_bstr(L"#cdata-section", p); }
static HRESULT WINAPI domcdata_get_nodeValue( @@ -352,11 +349,10 @@ static HRESULT WINAPI domcdata_get_nodeTypeString( BSTR* p) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - static const WCHAR cdatasectionW[] = {'c','d','a','t','a','s','e','c','t','i','o','n',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(cdatasectionW, p); + return return_bstr(L"cdatasection", p); }
static HRESULT WINAPI domcdata_get_text( diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index 78ac2a52dee..ba0a4282174 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -158,11 +158,9 @@ static HRESULT WINAPI domcomment_get_nodeName( { domcomment *This = impl_from_IXMLDOMComment( iface );
- static const WCHAR commentW[] = {'#','c','o','m','m','e','n','t',0}; - TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(commentW, p); + return return_bstr(L"#comment", p); }
static HRESULT WINAPI domcomment_get_nodeValue( @@ -351,11 +349,10 @@ static HRESULT WINAPI domcomment_get_nodeTypeString( BSTR* p) { domcomment *This = impl_from_IXMLDOMComment( iface ); - static const WCHAR commentW[] = {'c','o','m','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(commentW, p); + return return_bstr(L"comment", p); }
static HRESULT WINAPI domcomment_get_text( diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c index c307b6751f9..ab16fbe2c4d 100644 --- a/dlls/msxml3/docfrag.c +++ b/dlls/msxml3/docfrag.c @@ -157,12 +157,9 @@ static HRESULT WINAPI domfrag_get_nodeName( { domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
- static const WCHAR document_fragmentW[] = - {'#','d','o','c','u','m','e','n','t','-','f','r','a','g','m','e','n','t',0}; - TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(document_fragmentW, p); + return return_bstr(L"#document-fragment", p); }
static HRESULT WINAPI domfrag_get_nodeValue( @@ -349,11 +346,10 @@ static HRESULT WINAPI domfrag_get_nodeTypeString( BSTR* p) { domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); - static const WCHAR documentfragmentW[] = {'d','o','c','u','m','e','n','t','f','r','a','g','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(documentfragmentW, p); + return return_bstr(L"documentfragment", p); }
static HRESULT WINAPI domfrag_get_text( diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 0a4914c9482..8407f914c4f 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -49,19 +49,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
-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 PropertySelectionNamespacesW[] = {'S','e','l','e','c','t','i','o','n','N','a','m','e','s','p','a','c','e','s',0}; -static const WCHAR PropertyProhibitDTDW[] = {'P','r','o','h','i','b','i','t','D','T','D',0}; -static const WCHAR PropertyNewParserW[] = {'N','e','w','P','a','r','s','e','r',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}; -static const WCHAR PropertyResolveExternalsW[] = {'R','e','s','o','l','v','e','E','x','t','e','r','n','a','l','s',0}; -static const WCHAR PropertyAllowXsltScriptW[] = {'A','l','l','o','w','X','s','l','t','S','c','r','i','p','t',0}; -static const WCHAR PropertyAllowDocumentFunctionW[] = {'A','l','l','o','w','D','o','c','u','m','e','n','t','F','u','n','c','t','i','o','n',0}; -static const WCHAR PropertyNormalizeAttributeValuesW[] = {'N','o','r','m','a','l','i','z','e','A','t','t','r','i','b','u','t','e','V','a','l','u','e','s',0}; -static const WCHAR PropertyValidateOnParse[] = L"ValidateOnParse"; -static const WCHAR PropertyMaxElementDepth[] = L"MaxElementDepth"; - /* Anything that passes the test_get_ownerDocument() * tests can go here (data shared between all instances). * We need to preserve this when reloading a document, @@ -1060,11 +1047,9 @@ static HRESULT WINAPI domdoc_get_nodeName( { domdoc *This = impl_from_IXMLDOMDocument3( iface );
- static const WCHAR documentW[] = {'#','d','o','c','u','m','e','n','t',0}; - TRACE("(%p)->(%p)\n", This, name);
- return return_bstr(documentW, name); + return return_bstr(L"#document", name); }
@@ -1317,11 +1302,10 @@ static HRESULT WINAPI domdoc_get_nodeTypeString( BSTR *p) { domdoc *This = impl_from_IXMLDOMDocument3( iface ); - static const WCHAR documentW[] = {'d','o','c','u','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(documentW, p); + return return_bstr(L"document", p); }
@@ -2394,13 +2378,12 @@ static HRESULT WINAPI domdoc_get_parseError( IXMLDOMParseError** errorObj ) { domdoc *This = impl_from_IXMLDOMDocument3( iface ); - static const WCHAR err[] = {'e','r','r','o','r',0}; BSTR error_string = NULL;
FIXME("(%p)->(%p): creating a dummy parseError\n", iface, errorObj);
if(This->error) - error_string = SysAllocString(err); + error_string = SysAllocString(L"error");
*errorObj = create_parseError(This->error, NULL, error_string, NULL, 0, 0, 0); if(!*errorObj) return E_OUTOFMEMORY; @@ -2573,10 +2556,9 @@ static char *xmldoc_encoding(IXMLDOMDocument3 *doc) hr = IXMLDOMNode_get_attributes(node, &node_map); if (hr == S_OK) { - static const WCHAR encodingW[] = {'e','n','c','o','d','i','n','g',0}; BSTR bstr;
- bstr = SysAllocString(encodingW); + bstr = SysAllocString(L"encoding"); hr = IXMLDOMNamedNodeMap_getNamedItem(node_map, bstr, &item); SysFreeString(bstr); if (hr == S_OK) @@ -3027,7 +3009,7 @@ static HRESULT WINAPI domdoc_setProperty(
TRACE("(%p)->(%s %s)\n", This, debugstr_w(p), debugstr_variant(&value));
- if (lstrcmpiW(p, PropertySelectionLanguageW) == 0) + if (wcsicmp(p, L"SelectionLanguage") == 0) { VARIANT varStr; HRESULT hr; @@ -3044,9 +3026,9 @@ static HRESULT WINAPI domdoc_setProperty( bstr = V_BSTR(&value);
hr = S_OK; - if (lstrcmpiW(bstr, PropValueXPathW) == 0) + if (wcsicmp(bstr, L"XPath") == 0) This->properties->XPath = TRUE; - else if (lstrcmpiW(bstr, PropValueXSLPatternW) == 0) + else if (wcsicmp(bstr, L"XSLPattern") == 0) This->properties->XPath = FALSE; else hr = E_FAIL; @@ -3054,7 +3036,7 @@ static HRESULT WINAPI domdoc_setProperty( VariantClear(&varStr); return hr; } - else if (lstrcmpiW(p, PropertySelectionNamespacesW) == 0) + else if (wcsicmp(p, L"SelectionNamespaces") == 0) { xmlChar *nsStr = (xmlChar*)This->properties->selectNsStr; struct list *pNsList; @@ -3186,7 +3168,7 @@ static HRESULT WINAPI domdoc_setProperty( VariantClear(&varStr); return hr; } - else if (lstrcmpiW(p, PropertyValidateOnParse) == 0) + else if (wcsicmp(p, L"ValidateOnParse") == 0) { if (This->properties->version < MSXML4) return E_FAIL; @@ -3196,13 +3178,13 @@ static HRESULT WINAPI domdoc_setProperty( return S_OK; } } - else if (lstrcmpiW(p, PropertyProhibitDTDW) == 0 || - lstrcmpiW(p, PropertyNewParserW) == 0 || - lstrcmpiW(p, PropertyResolveExternalsW) == 0 || - lstrcmpiW(p, PropertyAllowXsltScriptW) == 0 || - lstrcmpiW(p, PropertyNormalizeAttributeValuesW) == 0 || - lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0 || - lstrcmpiW(p, PropertyMaxElementDepth) == 0) + else if (wcsicmp(p, L"ProhibitDTD") == 0 || + wcsicmp(p, L"NewParser") == 0 || + wcsicmp(p, L"ResolveExternals") == 0 || + wcsicmp(p, L"AllowXsltScript") == 0 || + wcsicmp(p, L"NormalizeAttributeValues") == 0 || + wcsicmp(p, L"AllowDocumentFunction") == 0 || + wcsicmp(p, L"MaxElementDepth") == 0) { /* Ignore */ FIXME("Ignoring property %s, value %s\n", debugstr_w(p), debugstr_variant(&value)); @@ -3225,15 +3207,15 @@ static HRESULT WINAPI domdoc_getProperty( if (!var) return E_INVALIDARG;
- if (lstrcmpiW(p, PropertySelectionLanguageW) == 0) + if (wcsicmp(p, L"SelectionLanguage") == 0) { V_VT(var) = VT_BSTR; V_BSTR(var) = This->properties->XPath ? - SysAllocString(PropValueXPathW) : - SysAllocString(PropValueXSLPatternW); + SysAllocString(L"XPath") : + SysAllocString(L"XSLPattern"); return V_BSTR(var) ? S_OK : E_OUTOFMEMORY; } - else if (lstrcmpiW(p, PropertySelectionNamespacesW) == 0) + else if (wcsicmp(p, L"SelectionNamespaces") == 0) { int lenA, lenW; BSTR rebuiltStr, cur; @@ -3268,7 +3250,7 @@ static HRESULT WINAPI domdoc_getProperty( free(rebuiltStr); return S_OK; } - else if (lstrcmpiW(p, PropertyValidateOnParse) == 0) + else if (wcsicmp(p, L"ValidateOnParse") == 0) { if (This->properties->version < MSXML4) return E_FAIL; diff --git a/dlls/msxml3/domimpl.c b/dlls/msxml3/domimpl.c index d1af4f0bb09..6442df3dcd3 100644 --- a/dlls/msxml3/domimpl.c +++ b/dlls/msxml3/domimpl.c @@ -138,10 +138,6 @@ static HRESULT WINAPI domimpl_Invoke(
static HRESULT WINAPI domimpl_hasFeature(IXMLDOMImplementation* This, BSTR feature, BSTR version, VARIANT_BOOL *hasFeature) { - static const WCHAR bVersion[] = {'1','.','0',0}; - static const WCHAR bXML[] = {'X','M','L',0}; - static const WCHAR bDOM[] = {'D','O','M',0}; - static const WCHAR bMSDOM[] = {'M','S','-','D','O','M',0}; BOOL bValidFeature = FALSE; BOOL bValidVersion = FALSE;
@@ -152,10 +148,10 @@ static HRESULT WINAPI domimpl_hasFeature(IXMLDOMImplementation* This, BSTR featu
*hasFeature = VARIANT_FALSE;
- if(!version || lstrcmpiW(version, bVersion) == 0) + if(!version || wcsicmp(version, L"1.0") == 0) bValidVersion = TRUE;
- if(lstrcmpiW(feature, bXML) == 0 || lstrcmpiW(feature, bDOM) == 0 || lstrcmpiW(feature, bMSDOM) == 0) + if(wcsicmp(feature, L"XML") == 0 || wcsicmp(feature, L"DOM") == 0 || wcsicmp(feature, L"MS-DOM") == 0) bValidFeature = TRUE;
if(bValidVersion && bValidFeature) diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 72d6f1b1223..0fe72dcef9c 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -384,11 +384,10 @@ static HRESULT WINAPI domelem_get_nodeTypeString( BSTR* p) { domelem *This = impl_from_IXMLDOMElement( iface ); - static const WCHAR elementW[] = {'e','l','e','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(elementW, p); + return return_bstr(L"element", p); }
static HRESULT WINAPI domelem_get_text( @@ -1414,7 +1413,6 @@ static HRESULT WINAPI domelem_setAttributeNode( IXMLDOMAttribute** old) { domelem *This = impl_from_IXMLDOMElement( iface ); - static const WCHAR xmlnsW[] = {'x','m','l','n','s',0}; xmlChar *name, *value; BSTR nameW, prefix; xmlnode *attr_node; @@ -1439,7 +1437,7 @@ static HRESULT WINAPI domelem_setAttributeNode( if (hr != S_OK) return hr;
/* adding xmlns attribute doesn't change a tree or existing namespace definition */ - if (!wcscmp(nameW, xmlnsW)) + if (!wcscmp(nameW, L"xmlns")) { SysFreeString(nameW); return DISP_E_UNKNOWNNAME; diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c index d4eec369d58..d9947428964 100644 --- a/dlls/msxml3/entityref.c +++ b/dlls/msxml3/entityref.c @@ -346,11 +346,10 @@ static HRESULT WINAPI entityref_get_nodeTypeString( BSTR* p) { entityref *This = impl_from_IXMLDOMEntityReference( iface ); - static const WCHAR entityreferenceW[] = {'e','n','t','i','t','y','r','e','f','e','r','e','n','c','e',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(entityreferenceW, p); + return return_bstr(L"entityreference", p); }
static HRESULT WINAPI entityref_get_text( diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index 6e4ab4c6519..90be57ebabf 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -42,8 +42,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
-static const WCHAR colspaceW[] = {':',' ',0}; -static const WCHAR crlfW[] = {'\r','\n',0}; static const DWORD safety_supported_options = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | @@ -459,9 +457,7 @@ static ULONG WINAPI BSCHttpNegotiate_Release(IHttpNegotiate *iface) static HRESULT WINAPI BSCHttpNegotiate_BeginningTransaction(IHttpNegotiate *iface, LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR *add_headers) { - static const WCHAR content_type_utf8W[] = {'C','o','n','t','e','n','t','-','T','y','p','e',':',' ', - 't','e','x','t','/','p','l','a','i','n',';','c','h','a','r','s','e','t','=','u','t','f','-','8','\r','\n',0}; - static const WCHAR refererW[] = {'R','e','f','e','r','e','r',':',' ',0}; + static const WCHAR content_type_utf8W[] = L"Content-Type: text/plain;charset=utf-8\r\n";
BindStatusCallback *This = impl_from_IHttpNegotiate(iface); const struct httpheader *entry; @@ -482,7 +478,7 @@ static HRESULT WINAPI BSCHttpNegotiate_BeginningTransaction(IHttpNegotiate *ifac if (This->request->base_uri) { IUri_GetRawUri(This->request->base_uri, &base_uri); - size += SysStringLen(base_uri)*sizeof(WCHAR) + sizeof(refererW) + sizeof(crlfW); + size += SysStringLen(base_uri)*sizeof(WCHAR) + sizeof(L"Referer: ") + sizeof(L"\r\n"); }
if (!size) @@ -507,10 +503,10 @@ static HRESULT WINAPI BSCHttpNegotiate_BeginningTransaction(IHttpNegotiate *ifac
if (base_uri) { - lstrcpyW(ptr, refererW); + lstrcpyW(ptr, L"Referer: "); lstrcatW(ptr, base_uri); - lstrcatW(ptr, crlfW); - ptr += lstrlenW(refererW) + SysStringLen(base_uri) + lstrlenW(crlfW); + lstrcatW(ptr, L"\r\n"); + ptr += lstrlenW(L"Referer: ") + SysStringLen(base_uri) + lstrlenW(L"\r\n"); SysFreeString(base_uri); }
@@ -520,14 +516,14 @@ static HRESULT WINAPI BSCHttpNegotiate_BeginningTransaction(IHttpNegotiate *ifac lstrcpyW(ptr, entry->header); ptr += SysStringLen(entry->header);
- lstrcpyW(ptr, colspaceW); - ptr += ARRAY_SIZE(colspaceW) - 1; + lstrcpyW(ptr, L": "); + ptr += 2;
lstrcpyW(ptr, entry->value); ptr += SysStringLen(entry->value);
- lstrcpyW(ptr, crlfW); - ptr += ARRAY_SIZE(crlfW) - 1; + lstrcpyW(ptr, L"\r\n"); + ptr += 2; }
*add_headers = buff; @@ -869,12 +865,6 @@ static HRESULT verify_uri(httprequest *This, IUri *uri) static HRESULT httprequest_open(httprequest *This, BSTR method, BSTR url, VARIANT async, VARIANT user, VARIANT password) { - static const WCHAR MethodHeadW[] = {'H','E','A','D',0}; - static const WCHAR MethodGetW[] = {'G','E','T',0}; - static const WCHAR MethodPutW[] = {'P','U','T',0}; - static const WCHAR MethodPostW[] = {'P','O','S','T',0}; - static const WCHAR MethodDeleteW[] = {'D','E','L','E','T','E',0}; - static const WCHAR MethodPropFindW[] = {'P','R','O','P','F','I','N','D',0}; VARIANT str, is_async; IUri *uri; HRESULT hr; @@ -892,21 +882,21 @@ static HRESULT httprequest_open(httprequest *This, BSTR method, BSTR url, This->user = This->password = NULL; free_request_headers(This);
- if (!wcsicmp(method, MethodGetW)) + if (!wcsicmp(method, L"GET")) { This->verb = BINDVERB_GET; } - else if (!wcsicmp(method, MethodPutW)) + else if (!wcsicmp(method, L"PUT")) { This->verb = BINDVERB_PUT; } - else if (!wcsicmp(method, MethodPostW)) + else if (!wcsicmp(method, L"POST")) { This->verb = BINDVERB_POST; } - else if (!wcsicmp(method, MethodDeleteW) || - !wcsicmp(method, MethodHeadW) || - !wcsicmp(method, MethodPropFindW)) + else if (!wcsicmp(method, L"DELETE") || + !wcsicmp(method, L"HEAD") || + !wcsicmp(method, L"PROPFIND")) { This->verb = BINDVERB_CUSTOM; SysReAllocString(&This->custom, method); @@ -1013,8 +1003,8 @@ static HRESULT httprequest_setRequestHeader(httprequest *This, BSTR header, BSTR entry->value = SysAllocString(value);
/* header length including null terminator */ - This->reqheader_size += SysStringLen(entry->header) + ARRAY_SIZE(colspaceW) + - SysStringLen(entry->value) + ARRAY_SIZE(crlfW) - 1; + This->reqheader_size += SysStringLen(entry->header) + sizeof(": ") - 1 + + SysStringLen(entry->value) + sizeof("\r\n");
list_add_head(&This->reqheaders, &entry->entry);
diff --git a/dlls/msxml3/mxnamespace.c b/dlls/msxml3/mxnamespace.c index 13a77e43f4f..68e2953af4d 100644 --- a/dlls/msxml3/mxnamespace.c +++ b/dlls/msxml3/mxnamespace.c @@ -51,10 +51,6 @@ struct nscontext
#define DEFAULT_PREFIX_ALLOC_COUNT 16
-static const WCHAR xmlW[] = {'x','m','l',0}; -static const WCHAR xmluriW[] = {'h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g', - '/','X','M','L','/','1','9','9','8','/','n','a','m','e','s','p','a','c','e',0}; - typedef struct { DispatchEx dispex; @@ -186,8 +182,8 @@ static struct nscontext* alloc_ns_context(void) }
/* first allocated prefix is always 'xml' */ - ctxt->ns[0].prefix = SysAllocString(xmlW); - ctxt->ns[0].uri = SysAllocString(xmluriW); + ctxt->ns[0].prefix = SysAllocString(L"xml"); + ctxt->ns[0].uri = SysAllocString(L"http://www.w3.org/XML/1998/namespace"); ctxt->count++; if (!ctxt->ns[0].prefix || !ctxt->ns[0].uri) { @@ -273,13 +269,11 @@ static HRESULT WINAPI namespacemanager_popContext(IMXNamespaceManager *iface) static HRESULT WINAPI namespacemanager_declarePrefix(IMXNamespaceManager *iface, const WCHAR *prefix, const WCHAR *namespaceURI) { - static const WCHAR xmlnsW[] = {'x','m','l','n','s',0}; - namespacemanager *This = impl_from_IMXNamespaceManager( iface );
TRACE("(%p)->(%s %s)\n", This, debugstr_w(prefix), debugstr_w(namespaceURI));
- if (prefix && (!wcscmp(prefix, xmlW) || !wcscmp(prefix, xmlnsW) || !namespaceURI)) + if (prefix && (!wcscmp(prefix, L"xml") || !wcscmp(prefix, L"xmlns") || !namespaceURI)) return E_INVALIDARG;
return declare_prefix(This, prefix, namespaceURI); diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index d46a3bc41b1..29b286356ec 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -77,48 +77,27 @@ struct xml_encoding_data UINT cp; };
-static const WCHAR iso_8859_1W[] = {'i','s','o','-','8','8','5','9','-','1',0}; -static const WCHAR iso_8859_2W[] = {'i','s','o','-','8','8','5','9','-','2',0}; -static const WCHAR iso_8859_3W[] = {'i','s','o','-','8','8','5','9','-','3',0}; -static const WCHAR iso_8859_4W[] = {'i','s','o','-','8','8','5','9','-','4',0}; -static const WCHAR iso_8859_5W[] = {'i','s','o','-','8','8','5','9','-','5',0}; -static const WCHAR iso_8859_7W[] = {'i','s','o','-','8','8','5','9','-','7',0}; -static const WCHAR iso_8859_9W[] = {'i','s','o','-','8','8','5','9','-','9',0}; -static const WCHAR iso_8859_13W[] = {'i','s','o','-','8','8','5','9','-','1','3',0}; -static const WCHAR iso_8859_15W[] = {'i','s','o','-','8','8','5','9','-','1','5',0}; -static const WCHAR utf16W[] = {'U','T','F','-','1','6',0}; -static const WCHAR utf8W[] = {'U','T','F','-','8',0}; -static const WCHAR windows_1250W[] = {'w','i','n','d','o','w','s','-','1','2','5','0',0}; -static const WCHAR windows_1251W[] = {'w','i','n','d','o','w','s','-','1','2','5','1',0}; -static const WCHAR windows_1252W[] = {'w','i','n','d','o','w','s','-','1','2','5','2',0}; -static const WCHAR windows_1253W[] = {'w','i','n','d','o','w','s','-','1','2','5','3',0}; -static const WCHAR windows_1254W[] = {'w','i','n','d','o','w','s','-','1','2','5','4',0}; -static const WCHAR windows_1255W[] = {'w','i','n','d','o','w','s','-','1','2','5','5',0}; -static const WCHAR windows_1256W[] = {'w','i','n','d','o','w','s','-','1','2','5','6',0}; -static const WCHAR windows_1257W[] = {'w','i','n','d','o','w','s','-','1','2','5','7',0}; -static const WCHAR windows_1258W[] = {'w','i','n','d','o','w','s','-','1','2','5','8',0}; - static const struct xml_encoding_data xml_encoding_map[] = { - { iso_8859_1W, XmlEncoding_ISO_8859_1, 28591 }, - { iso_8859_13W, XmlEncoding_ISO_8859_13, 28603 }, - { iso_8859_15W, XmlEncoding_ISO_8859_15, 28605 }, - { iso_8859_2W, XmlEncoding_ISO_8859_2, 28592 }, - { iso_8859_3W, XmlEncoding_ISO_8859_3, 28593 }, - { iso_8859_4W, XmlEncoding_ISO_8859_4, 28594 }, - { iso_8859_5W, XmlEncoding_ISO_8859_5, 28595 }, - { iso_8859_7W, XmlEncoding_ISO_8859_7, 28597 }, - { iso_8859_9W, XmlEncoding_ISO_8859_9, 28599 }, - { utf16W, XmlEncoding_UTF16, ~0 }, - { utf8W, XmlEncoding_UTF8, CP_UTF8 }, - { windows_1250W,XmlEncoding_windows_1250, 1250 }, - { windows_1251W,XmlEncoding_windows_1251, 1251 }, - { windows_1252W,XmlEncoding_windows_1252, 1252 }, - { windows_1253W,XmlEncoding_windows_1253, 1253 }, - { windows_1254W,XmlEncoding_windows_1254, 1254 }, - { windows_1255W,XmlEncoding_windows_1255, 1255 }, - { windows_1256W,XmlEncoding_windows_1256, 1256 }, - { windows_1257W,XmlEncoding_windows_1257, 1257 }, - { windows_1258W,XmlEncoding_windows_1258, 1258 } + { L"iso-8859-1", XmlEncoding_ISO_8859_1, 28591 }, + { L"iso-8859-13", XmlEncoding_ISO_8859_13, 28603 }, + { L"iso-8859-15", XmlEncoding_ISO_8859_15, 28605 }, + { L"iso-8859-2", XmlEncoding_ISO_8859_2, 28592 }, + { L"iso-8859-3", XmlEncoding_ISO_8859_3, 28593 }, + { L"iso-8859-4", XmlEncoding_ISO_8859_4, 28594 }, + { L"iso-8859-5", XmlEncoding_ISO_8859_5, 28595 }, + { L"iso-8859-7", XmlEncoding_ISO_8859_7, 28597 }, + { L"iso-8859-9", XmlEncoding_ISO_8859_9, 28599 }, + { L"UTF-16", XmlEncoding_UTF16, ~0 }, + { L"UTF-8", XmlEncoding_UTF8, CP_UTF8 }, + { L"windows-1250", XmlEncoding_windows_1250, 1250 }, + { L"windows-1251", XmlEncoding_windows_1251, 1251 }, + { L"windows-1252", XmlEncoding_windows_1252, 1252 }, + { L"windows-1253", XmlEncoding_windows_1253, 1253 }, + { L"windows-1254", XmlEncoding_windows_1254, 1254 }, + { L"windows-1255", XmlEncoding_windows_1255, 1255 }, + { L"windows-1256", XmlEncoding_windows_1256, 1256 }, + { L"windows-1257", XmlEncoding_windows_1257, 1257 }, + { L"windows-1258", XmlEncoding_windows_1258, 1258 } };
typedef enum @@ -588,7 +567,7 @@ static void write_prolog_buffer(mxwriter *writer) if (writer->dest) write_output_buffer(writer, writer->encoding, -1); else - write_output_buffer(writer, utf16W, ARRAY_SIZE(utf16W) - 1); + write_output_buffer(writer, L"UTF-16", ARRAY_SIZE(L"UTF-16") - 1); write_output_buffer(writer, quotW, 1);
/* standalone */ @@ -2589,7 +2568,6 @@ static dispex_static_data_t mxwriter_dispex = {
HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj) { - static const WCHAR version10W[] = {'1','.','0',0}; mxwriter *This; HRESULT hr;
@@ -2619,8 +2597,8 @@ HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj) This->props[MXWriter_OmitXmlDecl] = VARIANT_FALSE; This->props[MXWriter_Standalone] = VARIANT_FALSE; This->prop_changed = FALSE; - This->encoding = SysAllocString(utf16W); - This->version = SysAllocString(version10W); + This->encoding = SysAllocString(L"UTF-16"); + This->version = SysAllocString(L"1.0"); This->xml_enc = XmlEncoding_UTF16;
This->element = NULL; diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index 74f14f718e3..e37cf644f1b 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -191,8 +191,7 @@ static HRESULT WINAPI dom_pi_put_nodeValue( hr = IXMLDOMProcessingInstruction_get_nodeName(iface, &target); if(hr == S_OK) { - static const WCHAR xmlW[] = {'x','m','l',0}; - if(!wcscmp(target, xmlW)) + if(!wcscmp(target, L"xml")) { SysFreeString(target); return E_FAIL; @@ -420,7 +419,6 @@ static HRESULT WINAPI dom_pi_get_attributes( IXMLDOMNamedNodeMap** map) { dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); - static const WCHAR xmlW[] = {'x','m','l',0}; HRESULT hr; BSTR name;
@@ -433,7 +431,7 @@ static HRESULT WINAPI dom_pi_get_attributes( hr = node_get_nodeName(&This->node, &name); if (hr != S_OK) return hr;
- if (!wcscmp(name, xmlW)) + if (!wcscmp(name, L"xml")) *map = create_nodemap(This->node.node, &dom_pi_attr_map);
SysFreeString(name); @@ -516,12 +514,10 @@ static HRESULT WINAPI dom_pi_get_nodeTypeString( BSTR* p) { dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); - static const WCHAR processinginstructionW[] = - {'p','r','o','c','e','s','s','i','n','g','i','n','s','t','r','u','c','t','i','o','n',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(processinginstructionW, p); + return return_bstr(L"processinginstruction", p); }
static HRESULT WINAPI dom_pi_get_text( @@ -734,8 +730,7 @@ static HRESULT WINAPI dom_pi_put_data( hr = IXMLDOMProcessingInstruction_get_nodeName(iface, &target); if(hr == S_OK) { - static const WCHAR xmlW[] = {'x','m','l',0}; - if(!wcscmp(target, xmlW)) + if(!wcscmp(target, L"xml")) { SysFreeString(target); return E_FAIL; @@ -749,7 +744,6 @@ static HRESULT WINAPI dom_pi_put_data(
HRESULT dom_pi_put_xml_decl(IXMLDOMNode *node, BSTR data) { - static const WCHAR xmlW[] = {'x','m','l',0}; xmlnode *node_obj; HRESULT hr; BSTR name; @@ -766,7 +760,7 @@ HRESULT dom_pi_put_xml_decl(IXMLDOMNode *node, BSTR data) if (FAILED(hr)) return hr;
- if (!lstrcmpW(name, xmlW) && !node_obj->node->properties) + if (!wcscmp(name, L"xml") && !node_obj->node->properties) hr = parse_xml_decl(node_obj->node); else hr = S_OK; diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index b7dde7c9f4d..71a7f334420 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -63,45 +63,6 @@ typedef enum LexicalHandlerParEntities = 1 << 15 } saxreader_feature;
-/* feature names */ -static const WCHAR FeatureExternalGeneralEntitiesW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/','s','a','x','/', - 'f','e','a','t','u','r','e','s','/','e','x','t','e','r','n','a','l','-','g','e','n','e','r','a','l', - '-','e','n','t','i','t','i','e','s',0 -}; - -static const WCHAR FeatureExternalParameterEntitiesW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/','s','a','x','/','f','e','a','t','u','r','e','s', - '/','e','x','t','e','r','n','a','l','-','p','a','r','a','m','e','t','e','r','-','e','n','t','i','t','i','e','s',0 -}; - -static const WCHAR FeatureLexicalHandlerParEntitiesW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/','s','a','x','/','f','e','a','t','u','r','e','s', - '/','l','e','x','i','c','a','l','-','h','a','n','d','l','e','r','/','p','a','r','a','m','e','t','e','r','-','e','n','t','i','t','i','e','s',0 -}; - -static const WCHAR FeatureProhibitDTDW[] = { - 'p','r','o','h','i','b','i','t','-','d','t','d',0 -}; - -static const WCHAR FeatureNamespacesW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/','s','a','x','/','f','e','a','t','u','r','e','s', - '/','n','a','m','e','s','p','a','c','e','s',0 -}; - -static const WCHAR FeatureNamespacePrefixesW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/','s','a','x','/','f','e','a','t','u','r','e','s', - '/','n','a','m','e','s','p','a','c','e','-','p','r','e','f','i','x','e','s',0 -}; - -static const WCHAR ExhaustiveErrorsW[] = { - 'e','x','h','a','u','s','t','i','v','e','-','e','r','r','o','r','s',0 -}; - -static const WCHAR SchemaValidationW[] = { - 's','c','h','e','m','a','-','v','a','l','i','d','a','t','i','o','n',0 -}; - struct saxreader_feature_pair { saxreader_feature feature; @@ -109,14 +70,14 @@ struct saxreader_feature_pair };
static const struct saxreader_feature_pair saxreader_feature_map[] = { - { ExhaustiveErrors, ExhaustiveErrorsW }, - { ExternalGeneralEntities, FeatureExternalGeneralEntitiesW }, - { ExternalParameterEntities, FeatureExternalParameterEntitiesW }, - { LexicalHandlerParEntities, FeatureLexicalHandlerParEntitiesW }, - { NamespacePrefixes, FeatureNamespacePrefixesW }, - { Namespaces, FeatureNamespacesW }, - { ProhibitDTD, FeatureProhibitDTDW }, - { SchemaValidation, SchemaValidationW }, + { ExhaustiveErrors, L"exhaustive-errors" }, + { ExternalGeneralEntities, L"http://xml.org/sax/features/external-general-entities" }, + { ExternalParameterEntities, L"http://xml.org/sax/features/external-parameter-entities" }, + { LexicalHandlerParEntities, L"http://xml.org/sax/features/lexical-handler/parameter-entities" }, + { NamespacePrefixes, L"http://xml.org/sax/features/namespace-prefixes" }, + { Namespaces, L"http://xml.org/sax/features/namespaces" }, + { ProhibitDTD, L"prohibit-dtd" }, + { SchemaValidation, L"schema-validation" }, };
static saxreader_feature get_saxreader_feature(const WCHAR *name) @@ -370,50 +331,9 @@ static HRESULT saxreader_saxcharacters(saxlocator *locator, BSTR chars) }
/* property names */ -static const WCHAR PropertyCharsetW[] = { - 'c','h','a','r','s','e','t',0 -}; -static const WCHAR PropertyXmlDeclVersionW[] = { - 'x','m','l','d','e','c','l','-','v','e','r','s','i','o','n',0 -}; -static const WCHAR PropertyDeclHandlerW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/', - 's','a','x','/','p','r','o','p','e','r','t','i','e','s','/', - 'd','e','c','l','a','r','a','t','i','o','n', - '-','h','a','n','d','l','e','r',0 -}; -static const WCHAR PropertyDomNodeW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/', - 's','a','x','/','p','r','o','p','e','r','t','i','e','s','/', - 'd','o','m','-','n','o','d','e',0 -}; -static const WCHAR PropertyInputSourceW[] = { - 'i','n','p','u','t','-','s','o','u','r','c','e',0 -}; -static const WCHAR PropertyLexicalHandlerW[] = { - 'h','t','t','p',':','/','/','x','m','l','.','o','r','g','/', - 's','a','x','/','p','r','o','p','e','r','t','i','e','s','/', - 'l','e','x','i','c','a','l','-','h','a','n','d','l','e','r',0 -}; -static const WCHAR PropertyMaxElementDepthW[] = { - 'm','a','x','-','e','l','e','m','e','n','t','-','d','e','p','t','h',0 -}; -static const WCHAR PropertyMaxXMLSizeW[] = { - 'm','a','x','-','x','m','l','-','s','i','z','e',0 -}; -static const WCHAR PropertySchemaDeclHandlerW[] = { - 's','c','h','e','m','a','-','d','e','c','l','a','r','a','t','i','o','n','-', - 'h','a','n','d','l','e','r',0 -}; -static const WCHAR PropertyXMLDeclEncodingW[] = { - 'x','m','l','d','e','c','l','-','e','n','c','o','d','i','n','g',0 -}; -static const WCHAR PropertyXMLDeclStandaloneW[] = { - 'x','m','l','d','e','c','l','-','s','t','a','n','d','a','l','o','n','e',0 -}; -static const WCHAR PropertyXMLDeclVersionW[] = { - 'x','m','l','d','e','c','l','-','v','e','r','s','i','o','n',0 -}; +static const WCHAR PropertyDeclHandlerW[] = L"http://xml.org/sax/properties/declaration-handler"; +static const WCHAR PropertyDomNodeW[] = L"http://xml.org/sax/properties/dom-node"; +static const WCHAR PropertyLexicalHandlerW[] = L"http://xml.org/sax/properties/lexical-handler";
static inline HRESULT set_feature_value(saxreader *reader, saxreader_feature feature, VARIANT_BOOL value) { @@ -1388,7 +1308,7 @@ static const struct ISAXAttributesVtbl isaxattributes_vtbl = escaped to '&'. This function takes care of ampersands only. */ static BSTR saxreader_get_unescaped_value(const xmlChar *buf, int len) { - static const WCHAR ampescW[] = {'&','#','3','8',';',0}; + static const WCHAR ampescW[] = L"&"; WCHAR *dest, *ptrW, *str; DWORD str_len; BSTR bstr; @@ -1448,7 +1368,6 @@ static HRESULT SAXAttributes_populate(saxlocator *locator, int nb_attributes, const xmlChar **xmlAttributes) { static const xmlChar xmlns[] = "xmlns"; - static const WCHAR xmlnsW[] = { 'x','m','l','n','s',0 };
struct _attributes *attrs; int i; @@ -1490,7 +1409,7 @@ static HRESULT SAXAttributes_populate(saxlocator *locator,
SysFreeString(attrs[nb_attributes+i].szQName); if(!xmlNamespaces[2*i]) - attrs[nb_attributes+i].szQName = SysAllocString(xmlnsW); + attrs[nb_attributes+i].szQName = SysAllocString(L"xmlns"); else attrs[nb_attributes+i].szQName = QName_from_xmlChar(xmlns, xmlNamespaces[2*i]); } @@ -2431,9 +2350,6 @@ static const struct ISAXLocatorVtbl SAXLocatorVtbl =
static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, BOOL vbInterface) { - static const WCHAR w3xmlns[] = { 'h','t','t','p',':','/','/', 'w','w','w','.','w','3','.', - 'o','r','g','/','2','0','0','0','/','x','m','l','n','s','/',0 }; - saxlocator *locator;
locator = malloc(sizeof(*locator)); @@ -2457,7 +2373,7 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B locator->column = 0; locator->ret = S_OK; if (locator->saxreader->version >= MSXML6) - locator->namespaceUri = SysAllocString(w3xmlns); + locator->namespaceUri = SysAllocString(L"http://www.w3.org/2000/xmlns/"); else locator->namespaceUri = SysAllocStringLen(NULL, 0); if(!locator->namespaceUri) @@ -2800,14 +2716,14 @@ static HRESULT internal_putProperty( if(!memcmp(prop, PropertyLexicalHandlerW, sizeof(PropertyLexicalHandlerW))) return saxreader_put_handler_from_variant(This, SAXLexicalHandler, v, vbInterface);
- if(!memcmp(prop, PropertyMaxXMLSizeW, sizeof(PropertyMaxXMLSizeW))) + if(!memcmp(prop, L"max-xml-size", sizeof(L"max-xml-size"))) { if (V_VT(v) == VT_I4 && V_I4(v) == 0) return S_OK; FIXME("(%p)->(%s): max-xml-size unsupported\n", This, debugstr_variant(v)); return E_NOTIMPL; }
- if(!memcmp(prop, PropertyMaxElementDepthW, sizeof(PropertyMaxElementDepthW))) + if(!memcmp(prop, L"max-element-depth", sizeof(L"max-element-depth"))) { if (V_VT(v) == VT_I4 && V_I4(v) == 0) return S_OK; FIXME("(%p)->(%s): max-element-depth unsupported\n", This, debugstr_variant(v)); @@ -2816,25 +2732,25 @@ static HRESULT internal_putProperty(
FIXME("(%p)->(%s:%s): unsupported property\n", This, debugstr_w(prop), debugstr_variant(v));
- if(!memcmp(prop, PropertyCharsetW, sizeof(PropertyCharsetW))) + if(!memcmp(prop, L"charset", sizeof(L"charset"))) return E_NOTIMPL;
if(!memcmp(prop, PropertyDomNodeW, sizeof(PropertyDomNodeW))) return E_FAIL;
- if(!memcmp(prop, PropertyInputSourceW, sizeof(PropertyInputSourceW))) + if(!memcmp(prop, L"input-source", sizeof(L"input-source"))) return E_NOTIMPL;
- if(!memcmp(prop, PropertySchemaDeclHandlerW, sizeof(PropertySchemaDeclHandlerW))) + if(!memcmp(prop, L"schema-declaration-handler", sizeof(L"schema-declaration-handler"))) return E_NOTIMPL;
- if(!memcmp(prop, PropertyXMLDeclEncodingW, sizeof(PropertyXMLDeclEncodingW))) + if(!memcmp(prop, L"xmldecl-encoding", sizeof(L"xmldecl-encoding"))) return E_FAIL;
- if(!memcmp(prop, PropertyXMLDeclStandaloneW, sizeof(PropertyXMLDeclStandaloneW))) + if(!memcmp(prop, L"xmldecl-standalone", sizeof(L"xmldecl-standalone"))) return E_FAIL;
- if(!memcmp(prop, PropertyXMLDeclVersionW, sizeof(PropertyXMLDeclVersionW))) + if(!memcmp(prop, L"xmldecl-version", sizeof(L"xmldecl-version"))) return E_FAIL;
return E_INVALIDARG; @@ -2860,7 +2776,7 @@ static HRESULT internal_getProperty(const saxreader* This, const WCHAR *prop, VA return S_OK; }
- if (!memcmp(PropertyXmlDeclVersionW, prop, sizeof(PropertyXmlDeclVersionW))) + if (!memcmp(L"xmldecl-version", prop, sizeof(L"xmldecl-version"))) { V_VT(value) = VT_BSTR; V_BSTR(value) = SysAllocString(This->xmldecl_version); diff --git a/dlls/msxml3/schema.c b/dlls/msxml3/schema.c index bc1e4cd635a..2965d5e69b7 100644 --- a/dlls/msxml3/schema.c +++ b/dlls/msxml3/schema.c @@ -123,80 +123,6 @@ static const tid_t schema_cache_se_tids[] = { #define DT_MIN_HASH_VALUE 2 #define DT_MAX_HASH_VALUE 115
-static const xmlChar DT_bin_base64[] = "bin.base64"; -static const xmlChar DT_bin_hex[] = "bin.hex"; -static const xmlChar DT_boolean[] = "boolean"; -static const xmlChar DT_char[] = "char"; -static const xmlChar DT_date[] = "date"; -static const xmlChar DT_date_tz[] = "date.tz"; -static const xmlChar DT_dateTime[] = "dateTime"; -static const xmlChar DT_dateTime_tz[] = "dateTime.tz"; -static const xmlChar DT_entity[] = "entity"; -static const xmlChar DT_entities[] = "entities"; -static const xmlChar DT_enumeration[] = "enumeration"; -static const xmlChar DT_fixed_14_4[] = "fixed.14.4"; -static const xmlChar DT_float[] = "float"; -static const xmlChar DT_i1[] = "i1"; -static const xmlChar DT_i2[] = "i2"; -static const xmlChar DT_i4[] = "i4"; -static const xmlChar DT_i8[] = "i8"; -static const xmlChar DT_id[] = "id"; -static const xmlChar DT_idref[] = "idref"; -static const xmlChar DT_idrefs[] = "idrefs"; -static const xmlChar DT_int[] = "int"; -static const xmlChar DT_nmtoken[] = "nmtoken"; -static const xmlChar DT_nmtokens[] = "nmtokens"; -static const xmlChar DT_notation[] = "notation"; -static const xmlChar DT_number[] = "number"; -static const xmlChar DT_r4[] = "r4"; -static const xmlChar DT_r8[] = "r8"; -static const xmlChar DT_string[] = "string"; -static const xmlChar DT_time[] = "time"; -static const xmlChar DT_time_tz[] = "time.tz"; -static const xmlChar DT_ui1[] = "ui1"; -static const xmlChar DT_ui2[] = "ui2"; -static const xmlChar DT_ui4[] = "ui4"; -static const xmlChar DT_ui8[] = "ui8"; -static const xmlChar DT_uri[] = "uri"; -static const xmlChar DT_uuid[] = "uuid"; - -static const OLECHAR wDT_bin_base64[] = {'b','i','n','.','b','a','s','e','6','4',0}; -static const OLECHAR wDT_bin_hex[] = {'b','i','n','.','h','e','x',0}; -static const OLECHAR wDT_boolean[] = {'b','o','o','l','e','a','n',0}; -static const OLECHAR wDT_char[] = {'c','h','a','r',0}; -static const OLECHAR wDT_date[] = {'d','a','t','e',0}; -static const OLECHAR wDT_date_tz[] = {'d','a','t','e','.','t','z',0}; -static const OLECHAR wDT_dateTime[] = {'d','a','t','e','T','i','m','e',0}; -static const OLECHAR wDT_dateTime_tz[] = {'d','a','t','e','T','i','m','e','.','t','z',0}; -static const OLECHAR wDT_entity[] = {'e','n','t','i','t','y',0}; -static const OLECHAR wDT_entities[] = {'e','n','t','i','t','i','e','s',0}; -static const OLECHAR wDT_enumeration[] = {'e','n','u','m','e','r','a','t','i','o','n',0}; -static const OLECHAR wDT_fixed_14_4[] = {'f','i','x','e','d','.','1','4','.','4',0}; -static const OLECHAR wDT_float[] = {'f','l','o','a','t',0}; -static const OLECHAR wDT_i1[] = {'i','1',0}; -static const OLECHAR wDT_i2[] = {'i','2',0}; -static const OLECHAR wDT_i4[] = {'i','4',0}; -static const OLECHAR wDT_i8[] = {'i','8',0}; -static const OLECHAR wDT_id[] = {'i','d',0}; -static const OLECHAR wDT_idref[] = {'i','d','r','e','f',0}; -static const OLECHAR wDT_idrefs[] = {'i','d','r','e','f','s',0}; -static const OLECHAR wDT_int[] = {'i','n','t',0}; -static const OLECHAR wDT_nmtoken[] = {'n','m','t','o','k','e','n',0}; -static const OLECHAR wDT_nmtokens[] = {'n','m','t','o','k','e','n','s',0}; -static const OLECHAR wDT_notation[] = {'n','o','t','a','t','i','o','n',0}; -static const OLECHAR wDT_number[] = {'n','u','m','b','e','r',0}; -static const OLECHAR wDT_r4[] = {'r','4',0}; -static const OLECHAR wDT_r8[] = {'r','8',0}; -static const OLECHAR wDT_string[] = {'s','t','r','i','n','g',0}; -static const OLECHAR wDT_time[] = {'t','i','m','e',0}; -static const OLECHAR wDT_time_tz[] = {'t','i','m','e','.','t','z',0}; -static const OLECHAR wDT_ui1[] = {'u','i','1',0}; -static const OLECHAR wDT_ui2[] = {'u','i','2',0}; -static const OLECHAR wDT_ui4[] = {'u','i','4',0}; -static const OLECHAR wDT_ui8[] = {'u','i','8',0}; -static const OLECHAR wDT_uri[] = {'u','r','i',0}; -static const OLECHAR wDT_uuid[] = {'u','u','i','d',0}; - static const BYTE hash_assoc_values[] = { 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, @@ -396,85 +322,52 @@ static DWORD dt_hash_bstr(OLECHAR const* bstr, int len /* calculated if -1 */) return hval; }
-static const xmlChar *const DT_string_table[LAST_DT] = -{ - DT_bin_base64, - DT_bin_hex, - DT_boolean, - DT_char, - DT_date, - DT_date_tz, - DT_dateTime, - DT_dateTime_tz, - DT_entity, - DT_entities, - DT_enumeration, - DT_fixed_14_4, - DT_float, - DT_i1, - DT_i2, - DT_i4, - DT_i8, - DT_id, - DT_idref, - DT_idrefs, - DT_int, - DT_nmtoken, - DT_nmtokens, - DT_notation, - DT_number, - DT_r4, - DT_r8, - DT_string, - DT_time, - DT_time_tz, - DT_ui1, - DT_ui2, - DT_ui4, - DT_ui8, - DT_uri, - DT_uuid -}; - -static const WCHAR *const DT_wstring_table[LAST_DT] = -{ - wDT_bin_base64, - wDT_bin_hex, - wDT_boolean, - wDT_char, - wDT_date, - wDT_date_tz, - wDT_dateTime, - wDT_dateTime_tz, - wDT_entity, - wDT_entities, - wDT_enumeration, - wDT_fixed_14_4, - wDT_float, - wDT_i1, - wDT_i2, - wDT_i4, - wDT_i8, - wDT_id, - wDT_idref, - wDT_idrefs, - wDT_int, - wDT_nmtoken, - wDT_nmtokens, - wDT_notation, - wDT_number, - wDT_r4, - wDT_r8, - wDT_string, - wDT_time, - wDT_time_tz, - wDT_ui1, - wDT_ui2, - wDT_ui4, - wDT_ui8, - wDT_uri, - wDT_uuid +#define DT_ENTRY(name) { name, L##name } +static const struct +{ + xmlChar x[16]; + WCHAR w[16]; +} +DT_string_table[LAST_DT] = +{ + DT_ENTRY("bin.base64"), + DT_ENTRY("bin.hex"), + DT_ENTRY("boolean"), + DT_ENTRY("char"), + DT_ENTRY("date"), + DT_ENTRY("date.tz"), + DT_ENTRY("dateTime"), + DT_ENTRY("dateTime.tz"), + DT_ENTRY("entity"), + DT_ENTRY("entities"), + DT_ENTRY("enumeration"), + DT_ENTRY("fixed.14.4"), + DT_ENTRY("float"), + DT_ENTRY("i1"), + DT_ENTRY("i2"), + DT_ENTRY("i4"), + DT_ENTRY("i8"), + DT_ENTRY("id"), + DT_ENTRY("idref"), + DT_ENTRY("idrefs"), + DT_ENTRY("int"), + DT_ENTRY("nmtoken"), + DT_ENTRY("nmtokens"), + DT_ENTRY("notation"), + DT_ENTRY("number"), + DT_ENTRY("r4"), + DT_ENTRY("r8"), + DT_ENTRY("string"), + DT_ENTRY("time"), + DT_ENTRY("time.tz"), + DT_ENTRY("ui1"), + DT_ENTRY("ui2"), + DT_ENTRY("ui4"), + DT_ENTRY("ui8"), + DT_ENTRY("uri"), + DT_ENTRY("uuid"), }; +#undef DT_ENTRY
static const XDR_DT DT_lookup_table[] = { @@ -546,7 +439,7 @@ XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */) if (hash <= DT_MAX_HASH_VALUE) dt = DT_lookup_table[hash];
- if (dt != DT_INVALID && xmlStrcasecmp(str, DT_string_table[dt]) == 0) + if (dt != DT_INVALID && xmlStrcasecmp(str, DT_string_table[dt].x) == 0) return dt;
return DT_INVALID; @@ -560,7 +453,7 @@ XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */) if (hash <= DT_MAX_HASH_VALUE) dt = DT_lookup_table[hash];
- if (dt != DT_INVALID && lstrcmpiW(bstr, DT_wstring_table[dt]) == 0) + if (dt != DT_INVALID && wcsicmp(bstr, DT_string_table[dt].w) == 0) return dt;
return DT_INVALID; @@ -571,7 +464,7 @@ xmlChar const* dt_to_str(XDR_DT dt) if (dt == DT_INVALID) return NULL;
- return DT_string_table[dt]; + return DT_string_table[dt].x; }
OLECHAR const* dt_to_bstr(XDR_DT dt) @@ -579,12 +472,12 @@ OLECHAR const* dt_to_bstr(XDR_DT dt) if (dt == DT_INVALID) return NULL;
- return DT_wstring_table[dt]; + return DT_string_table[dt].w; }
const char* debugstr_dt(XDR_DT dt) { - return debugstr_a(dt != DT_INVALID ? (const char*)DT_string_table[dt] : NULL); + return debugstr_a(dt != DT_INVALID ? (const char*)DT_string_table[dt].x : NULL); }
HRESULT dt_validate(XDR_DT dt, xmlChar const* content) diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index f522a48c691..c2283760907 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -156,11 +156,9 @@ static HRESULT WINAPI domtext_get_nodeName( { domtext *This = impl_from_IXMLDOMText( iface );
- static const WCHAR textW[] = {'#','t','e','x','t',0}; - TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(textW, p); + return return_bstr(L"#text", p); }
static HRESULT WINAPI domtext_get_nodeValue( @@ -350,11 +348,10 @@ static HRESULT WINAPI domtext_get_nodeTypeString( BSTR* p) { domtext *This = impl_from_IXMLDOMText( iface ); - static const WCHAR textW[] = {'t','e','x','t',0};
TRACE("(%p)->(%p)\n", This, p);
- return return_bstr(textW, p); + return return_bstr(L"text", p); }
static HRESULT WINAPI domtext_get_text( diff --git a/dlls/msxml3/xmlelem.c b/dlls/msxml3/xmlelem.c index 218603c1c92..0d7d836f9e4 100644 --- a/dlls/msxml3/xmlelem.c +++ b/dlls/msxml3/xmlelem.c @@ -240,7 +240,6 @@ static HRESULT WINAPI xmlelem_setAttribute(IXMLElement *iface, BSTR strPropertyN static HRESULT WINAPI xmlelem_getAttribute(IXMLElement *iface, BSTR name, VARIANT *value) { - static const WCHAR xmllangW[] = { 'x','m','l',':','l','a','n','g',0 }; xmlelem *This = impl_from_IXMLElement(iface); xmlChar *val = NULL;
@@ -256,7 +255,7 @@ static HRESULT WINAPI xmlelem_getAttribute(IXMLElement *iface, BSTR name, return E_INVALIDARG;
/* case for xml:lang attribute */ - if (!lstrcmpiW(name, xmllangW)) + if (!lstrcmpiW(name, L"xml:lang")) { xmlNsPtr ns; ns = xmlSearchNs(This->node->doc, This->node, (xmlChar*)"xml"); diff --git a/dlls/msxml3/xmlview.c b/dlls/msxml3/xmlview.c index 0705741e857..f11545e0cca 100644 --- a/dlls/msxml3/xmlview.c +++ b/dlls/msxml3/xmlview.c @@ -366,11 +366,6 @@ static inline HRESULT display_error_page(BindStatusCallback *This)
static inline HRESULT handle_xml_load(BindStatusCallback *This) { - static const WCHAR selectW[] = {'p','r','o','c','e','s','s','i','n','g','-', - 'i','n','s','t','r','u','c','t','i','o','n','(',''','x','m','l', - '-','s','t','y','l','e','s','h','e','e','t',''',')',0}; - static const WCHAR hrefW[] = {'h','r','e','f','=',0}; - IXMLDOMDocument3 *xml = NULL, *xsl = NULL; IXMLDOMNode *stylesheet; IBindCtx *pbc; @@ -401,7 +396,7 @@ static inline HRESULT handle_xml_load(BindStatusCallback *This) } V_VT(&var) = VT_EMPTY;
- bstr = SysAllocString(selectW); + bstr = SysAllocString(L"processing-instruction('xml-stylesheet')"); hres = IXMLDOMDocument3_selectSingleNode(xml, bstr, &stylesheet); SysFreeString(bstr); if(hres != S_OK) { @@ -422,8 +417,8 @@ static inline HRESULT handle_xml_load(BindStatusCallback *This) }
/* TODO: fix parsing processing instruction value */ - if((p = wcsstr(V_BSTR(&var), hrefW))) { - p += ARRAY_SIZE(hrefW) - 1; + if((p = wcsstr(V_BSTR(&var), L"href="))) { + p += ARRAY_SIZE(L"href=") - 1; if(*p!=''' && *p!='"') p = NULL; else { href = p+1; @@ -907,12 +902,6 @@ static HRESULT WINAPI XMLView_PersistMoniker_IsDirty(IPersistMoniker *iface) static HRESULT WINAPI XMLView_PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode) { - static const WCHAR XSLParametersW[] = {'X','S','L','P','a','r','a','m','e','t','e','r','s',0}; - static const WCHAR XMLBufferStreamW[] = {'X','M','L','B','u','f','f','e','r','S','t','r','e','a','m',0}; - static const WCHAR DWNBINDINFOW[] = {'_','_','D','W','N','B','I','N','D','I','N','F','O',0}; - static const WCHAR HTMLLOADOPTIONSW[] = {'_','_','H','T','M','L','L','O','A','D','O','P','T','I','O','N','S',0}; - static const WCHAR BSCBHolderW[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; - XMLView *This = impl_from_IPersistMoniker(iface); IPersistMoniker *html_persist_mon; IBindStatusCallback *bsc, *bsc_html; @@ -924,12 +913,12 @@ static HRESULT WINAPI XMLView_PersistMoniker_Load(IPersistMoniker *iface,
TRACE("%p, %x, %p, %p, %lx.\n", iface, fFullyAvailable, pimkName, pibc, grfMode);
- hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)XSLParametersW, &unk); + hres = IBindCtx_GetObjectParam(pibc, (OLECHAR*)L"XSLParameters", &unk); if(SUCCEEDED(hres)) { FIXME("ignoring XSLParameters\n"); IUnknown_Release(unk); } - hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)XMLBufferStreamW, &unk); + hres = IBindCtx_GetObjectParam(pibc, (OLECHAR*)L"XMLBufferStream", &unk); if(SUCCEEDED(hres)) { FIXME("ignoring XMLBufferStream\n"); IUnknown_Release(unk); @@ -939,14 +928,14 @@ static HRESULT WINAPI XMLView_PersistMoniker_Load(IPersistMoniker *iface, if(FAILED(hres)) return hres;
- hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)DWNBINDINFOW, &unk); + hres = IBindCtx_GetObjectParam(pibc, (OLECHAR*)L"__DWNBINDINFO", &unk); if(SUCCEEDED(hres)) { - IBindCtx_RegisterObjectParam(bindctx, (LPOLESTR)DWNBINDINFOW, unk); + IBindCtx_RegisterObjectParam(bindctx, (OLECHAR*)L"__DWNBINDINFO", unk); IUnknown_Release(unk); } - hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)HTMLLOADOPTIONSW, &unk); + hres = IBindCtx_GetObjectParam(pibc, (OLECHAR*)L"__HTMLLOADOPTIONS", &unk); if(SUCCEEDED(hres)) { - IBindCtx_RegisterObjectParam(bindctx, (LPOLESTR)HTMLLOADOPTIONSW, unk); + IBindCtx_RegisterObjectParam(bindctx, (OLECHAR*)L"__HTMLLOADOPTIONS", unk); IUnknown_Release(unk); } hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk); @@ -991,7 +980,7 @@ static HRESULT WINAPI XMLView_PersistMoniker_Load(IPersistMoniker *iface, return hres; }
- hres = IBindCtx_GetObjectParam(bindctx, (LPOLESTR)BSCBHolderW, &unk); + hres = IBindCtx_GetObjectParam(bindctx, (OLECHAR*)L"_BSCB_Holder_", &unk); IBindCtx_Release(bindctx); if(FAILED(hres)) { IStream_Release(stream);