* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "precomp.h"
+#define COBJMACROS
-#include <assert.h>
+#include "config.h"
+#include <stdarg.h>
+#include <assert.h>
#ifdef HAVE_LIBXML2
+# include <libxml/parser.h>
+# include <libxml/xmlerror.h>
# include <libxml/xpathInternals.h>
# include <libxml/xmlsave.h>
# include <libxml/SAX2.h>
# include <libxml/parserInternals.h>
#endif
-#include <olectl.h>
-#include <objsafe.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "ole2.h"
+#include "olectl.h"
+#include "msxml6.h"
+#include "wininet.h"
+#include "winreg.h"
+#include "shlwapi.h"
+#include "ocidl.h"
+#include "objsafe.h"
+
+#include "wine/debug.h"
+
+#include "msxml_private.h"
#ifdef HAVE_LIBXML2
+WINE_DEFAULT_DEBUG_CHANNEL(msxml);
+
/* not defined in older versions */
#define XML_SAVE_FORMAT 1
#define XML_SAVE_NO_DECL 2
xmlChar const* selectNsStr;
LONG selectNsStr_len;
BOOL XPath;
- WCHAR *url;
+ IUri *uri;
} domdoc_properties;
typedef struct ConnectionPoint ConnectionPoint;
properties->version = version;
properties->XPath = (version == MSXML4 || version == MSXML6);
- /* document url */
- properties->url = NULL;
+ /* document uri */
+ properties->uri = NULL;
return properties;
}
list_add_tail(&pcopy->selectNsList, &new_ns->entry);
}
- if (properties->url)
- {
- int len = strlenW(properties->url);
-
- pcopy->url = CoTaskMemAlloc((len+1)*sizeof(WCHAR));
- memcpy(pcopy->url, properties->url, len*sizeof(WCHAR));
- pcopy->url[len] = 0;
- }
- else
- pcopy->url = NULL;
+ pcopy->uri = properties->uri;
+ if (pcopy->uri)
+ IUri_AddRef(pcopy->uri);
}
return pcopy;
IXMLDOMSchemaCollection2_Release(properties->schemaCache);
clear_selectNsList(&properties->selectNsList);
heap_free((xmlChar*)properties->selectNsStr);
- CoTaskMemFree(properties->url);
+ if (properties->uri)
+ IUri_Release(properties->uri);
heap_free(properties);
}
}
if ( filename )
{
IMoniker *mon;
+ IUri *uri;
- CoTaskMemFree(This->properties->url);
- This->properties->url = NULL;
+ if (This->properties->uri)
+ {
+ IUri_Release(This->properties->uri);
+ This->properties->uri = NULL;
+ }
- hr = create_moniker_from_url( filename, &mon);
+ hr = create_uri(filename, &uri);
+ if (SUCCEEDED(hr))
+ hr = CreateURLMonikerEx2(NULL, uri, &mon, 0);
if ( SUCCEEDED(hr) )
{
hr = domdoc_load_moniker( This, mon );
- if (hr == S_OK)
- IMoniker_GetDisplayName(mon, NULL, NULL, &This->properties->url);
IMoniker_Release(mon);
}
This->error = E_FAIL;
else
{
+ get_doc(This)->name = (char *)xmlchar_from_wcharn(filename, -1, TRUE);
+ This->properties->uri = uri;
hr = This->error = S_OK;
*isSuccessful = VARIANT_TRUE;
}
if (!url)
return E_INVALIDARG;
- if (This->properties->url)
- {
- *url = SysAllocString(This->properties->url);
- if (!*url)
- return E_OUTOFMEMORY;
-
- return S_OK;
- }
- else
+ if (!This->properties->uri)
return return_null_bstr(url);
+
+ return IUri_GetPropertyBSTR(This->properties->uri, Uri_PROPERTY_DISPLAY_URI, url, 0);
}