46static const xmlChar DT_prefix[] =
"dt";
47static const xmlChar DT_nsURI[] =
"urn:schemas-microsoft-com:datatypes";
49typedef struct _domelem
56static const struct nodemap_funcs domelem_attr_map;
58static const tid_t domelem_se_tids[] = {
64static inline domelem *impl_from_IXMLDOMElement(
IXMLDOMElement *iface )
71 return This->node.node;
79 domelem *
This = impl_from_IXMLDOMElement( iface );
96 return node_create_supporterrorinfo(domelem_se_tids,
ppvObject);
112 domelem *
This = impl_from_IXMLDOMElement( iface );
123 domelem *
This = impl_from_IXMLDOMElement( iface );
129 destroy_xmlnode(&
This->node);
140 domelem *
This = impl_from_IXMLDOMElement( iface );
141 return IDispatchEx_GetTypeInfoCount(&
This->node.dispex.IDispatchEx_iface, pctinfo);
149 domelem *
This = impl_from_IXMLDOMElement( iface );
150 return IDispatchEx_GetTypeInfo(&
This->node.dispex.IDispatchEx_iface,
151 iTInfo, lcid, ppTInfo);
159 domelem *
This = impl_from_IXMLDOMElement( iface );
160 return IDispatchEx_GetIDsOfNames(&
This->node.dispex.IDispatchEx_iface,
161 riid, rgszNames, cNames, lcid, rgDispId);
168 EXCEPINFO* pExcepInfo,
UINT* puArgErr )
170 domelem *
This = impl_from_IXMLDOMElement( iface );
171 return IDispatchEx_Invoke(&
This->node.dispex.IDispatchEx_iface,
172 dispIdMember,
riid, lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
179 domelem *
This = impl_from_IXMLDOMElement( iface );
183 return node_get_nodeName(&
This->node,
p);
190 domelem *
This = impl_from_IXMLDOMElement( iface );
206 domelem *
This = impl_from_IXMLDOMElement( iface );
215 domelem *
This = impl_from_IXMLDOMElement( iface );
217 TRACE(
"(%p)->(%p)\n",
This, domNodeType);
227 domelem *
This = impl_from_IXMLDOMElement( iface );
238 domelem *
This = impl_from_IXMLDOMElement( iface );
242 return node_get_child_nodes(&
This->node, outList);
249 domelem *
This = impl_from_IXMLDOMElement( iface );
253 return node_get_first_child(&
This->node, domNode);
260 domelem *
This = impl_from_IXMLDOMElement( iface );
264 return node_get_last_child(&
This->node, domNode);
271 domelem *
This = impl_from_IXMLDOMElement( iface );
275 return node_get_previous_sibling(&
This->node, domNode);
282 domelem *
This = impl_from_IXMLDOMElement( iface );
286 return node_get_next_sibling(&
This->node, domNode);
293 domelem *
This = impl_from_IXMLDOMElement( iface );
297 *
map = create_nodemap(
This->node.node, &domelem_attr_map);
306 domelem *
This = impl_from_IXMLDOMElement( iface );
312 hr = IXMLDOMNode_get_nodeType(newNode, &
type);
322 if (old_node) *old_node =
NULL;
325 return node_insert_before(&
This->node, newNode, &refChild, old_node);
335 domelem *
This = impl_from_IXMLDOMElement( iface );
337 TRACE(
"(%p)->(%p %p %p)\n",
This, newNode, oldNode, outOldNode);
339 return node_replace_child(&
This->node, newNode, oldNode, outOldNode);
346 domelem *
This = impl_from_IXMLDOMElement( iface );
348 return node_remove_child(&
This->node,
child, oldChild);
355 domelem *
This = impl_from_IXMLDOMElement( iface );
357 return node_append_child(&
This->node,
child, outChild);
364 domelem *
This = impl_from_IXMLDOMElement( iface );
366 return node_has_childnodes(&
This->node,
ret);
373 domelem *
This = impl_from_IXMLDOMElement( iface );
375 return node_get_owner_doc(&
This->node, doc);
382 domelem *
This = impl_from_IXMLDOMElement( iface );
383 TRACE(
"(%p)->(%d %p)\n",
This, deep, outNode);
384 return node_clone( &
This->node, deep, outNode );
391 domelem *
This = impl_from_IXMLDOMElement( iface );
392 static const WCHAR elementW[] = {
'e',
'l',
'e',
'm',
'e',
'n',
't',0};
403 domelem *
This = impl_from_IXMLDOMElement( iface );
405 return node_get_text(&
This->node,
p);
412 domelem *
This = impl_from_IXMLDOMElement( iface );
414 return node_put_text( &
This->node,
p );
421 domelem *
This = impl_from_IXMLDOMElement( iface );
422 FIXME(
"(%p)->(%p) stub!\n",
This, isSpecified);
423 *isSpecified = VARIANT_TRUE;
431 domelem *
This = impl_from_IXMLDOMElement( iface );
432 FIXME(
"(%p)->(%p)\n",
This, definitionNode);
438 if(
c <=
'9')
return c-
'0';
439 if(
c <=
'F')
return c-
'A'+10;
445 if(
c ==
'+')
return 62;
446 if(
c ==
'/')
return 63;
447 if(
c <=
'9')
return c-
'0'+52;
448 if(
c <=
'Z')
return c-
'A';
503 if(
p+4<
e && *(
p+4)==
'-')
513 if(
p+2<
e && *(
p+2)==
':')
557 + hex_to_byte(
str[2*
i+1]);
572 if ( *c2 ==
' ' || *c2 ==
'\t' ||
573 *c2 ==
'\n' || *c2 ==
'\r' )
584 else if(
str[
len-1] ==
'=')
i = 1;
599 + (base64_to_byte(
str[4*
i+1])>>4);
602 + (base64_to_byte(
str[4*
i+2])>>2);
605 + base64_to_byte(
str[4*
i+3]);
656 FIXME(
"need to handle dt:%s\n", debugstr_dt(dt));
664 WARN(
"unknown type %d\n", dt);
689 FIXME(
"invalid element node\n");
695 dt = str_to_dt(
node->name, -1);
702 dt = str_to_dt(pVal, -1);
707 IXMLDOMDocument3* doc = (IXMLDOMDocument3*)create_domdoc((
xmlNodePtr)
node->doc);
713 if (IXMLDOMDocument3_get_schemas(doc, &
v) ==
S_OK &&
716 dt = SchemaCache_get_node_dt((IXMLDOMSchemaCollection2*)
V_DISPATCH(&
v),
node);
719 IXMLDOMDocument3_Release(doc);
724 TRACE(
"=> dt:%s\n", debugstr_dt(dt));
732 domelem *
This = impl_from_IXMLDOMElement( iface );
743 dt = element_get_dt(get_element(
This));
753 static const char b64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
760 pad_bytes = (
bytes % 4) ? 4 - (
bytes % 4) : 0;
762 TRACE(
"%d, bytes is %d, pad bytes is %d\n",
len,
bytes, pad_bytes);
763 needed =
bytes + pad_bytes + 1;
775 *
ptr++ =
b64[ (
d[0] >> 2) & 0x3f ];
778 *
ptr++ =
b64[ ((
d[0] << 4) & 0x30) | (
d[1] >> 4 & 0x0f)];
781 *
ptr++ =
b64[ ((
d[1] << 2) & 0x3c) | (
d[2] >> 6 & 0x03)];
792 *
ptr++ =
b64[ (
d[0] >> 2) & 0x3f ];
795 *
ptr++ =
b64[ ((
d[0] << 4) & 0x30) | (
d[1] >> 4 & 0x0f)];
798 *
ptr++ =
b64[ ((
d[1] << 2) & 0x3c) ];
804 *
ptr++ =
b64[ (
d[0] >> 2) & 0x3f ];
807 *
ptr++ =
b64[ ((
d[0] << 4) & 0x30)];
820 static const char byte_to_hex[16] =
"0123456789abcdef";
828 (*ret)[2*
i] = byte_to_hex[
buf[
i] >> 4];
829 (*ret)[2*
i+1] = byte_to_hex[0x0f &
buf[
i]];
839 domelem *
This = impl_from_IXMLDOMElement( iface );
845 dt = element_get_dt(get_element(
This));
876 FIXME(
"unexpected array dimension count %u\n", dim);
890 hr = node_set_content(&
This->node, encoded);
895 FIXME(
"unhandled variant type %d for dt:%s\n",
V_VT(&
value), debugstr_dt(dt));
909 FIXME(
"unexpected array dimension count %u\n", dim);
919 hr = encode_binhex(
ptr,
len, &encoded);
923 hr = node_set_content(&
This->node, encoded);
928 FIXME(
"unhandled variant type %d for dt:%s\n",
V_VT(&
value), debugstr_dt(dt));
933 FIXME(
"not implemented for dt:%s\n", debugstr_dt(dt));
944 domelem *
This = impl_from_IXMLDOMElement( iface );
952 dt = element_get_dt(get_element(
This));
1001 domelem *
This = impl_from_IXMLDOMElement( iface );
1011 dt = bstr_to_dt(dtName, -1);
1017 hr = dt_validate(dt,
str);
1058 attr = xmlSetNsProp(get_element(
This),
attr->ns, DT_prefix, dt_to_str(dt));
1073 ERR(
"Failed to create Attribute\n");
1076 ERR(
"Failed to create Namespace\n");
1081 FIXME(
"need to handle dt:%s\n", debugstr_dt(dt));
1093 domelem *
This = impl_from_IXMLDOMElement( iface );
1097 return node_get_xml(&
This->node,
TRUE,
p);
1104 domelem *
This = impl_from_IXMLDOMElement( iface );
1106 return node_transform_node(&
This->node,
node,
p);
1113 domelem *
This = impl_from_IXMLDOMElement( iface );
1115 return node_select_nodes(&
This->node,
p, outList);
1122 domelem *
This = impl_from_IXMLDOMElement( iface );
1124 return node_select_singlenode(&
This->node,
p, outNode);
1131 domelem *
This = impl_from_IXMLDOMElement( iface );
1132 FIXME(
"(%p)->(%p) stub!\n",
This, isParsed);
1133 *isParsed = VARIANT_TRUE;
1141 domelem *
This = impl_from_IXMLDOMElement( iface );
1143 return node_get_namespaceURI(&
This->node,
p);
1150 domelem *
This = impl_from_IXMLDOMElement( iface );
1152 return node_get_prefix( &
This->node, prefix );
1159 domelem *
This = impl_from_IXMLDOMElement( iface );
1161 return node_get_base_name( &
This->node,
name );
1168 domelem *
This = impl_from_IXMLDOMElement( iface );
1177 domelem *
This = impl_from_IXMLDOMElement( iface );
1193 *
p = bstr_from_xmlChar(qname);
1203 domelem *
This = impl_from_IXMLDOMElement( iface );
1222 xml_name = xmlchar_from_wchar(
name );
1224 if(!xmlValidateNameValue(xml_name))
1266 domelem *
This = impl_from_IXMLDOMElement( iface );
1285 FIXME(
"VariantChangeType failed\n");
1289 xml_value = xmlchar_from_wchar(
V_BSTR(&
var));
1295 xml_name = xmlchar_from_wchar(
name );
1318 if (!xmlSetNsProp(
element,
NULL, xml_name, xml_value))
1331 domelem *
This = impl_from_IXMLDOMElement( iface );
1337 hr = IXMLDOMElement_get_attributes(iface, &
attr);
1340 hr = IXMLDOMNamedNodeMap_removeNamedItem(
attr,
p,
NULL);
1341 IXMLDOMNamedNodeMap_Release(
attr);
1350 domelem *
This = impl_from_IXMLDOMElement( iface );
1361 if (attributeNode) *attributeNode =
NULL;
1363 nameA = xmlchar_from_wchar(
p);
1364 if (!xmlValidateNameValue(nameA))
1376 *attributeNode =
NULL;
1402 hr = IUnknown_QueryInterface(unk, &IID_IXMLDOMAttribute, (
void**)attributeNode);
1403 IUnknown_Release(unk);
1414 domelem *
This = impl_from_IXMLDOMElement( iface );
1415 static const WCHAR xmlnsW[] = {
'x',
'm',
'l',
'n',
's',0};
1428 if (!attr_node)
return E_FAIL;
1430 if (attr_node->parent)
1432 WARN(
"attempt to add already used attribute\n");
1453 if (old) *old =
NULL;
1457 hr = IXMLDOMAttribute_get_prefix(
attribute, &prefix);
1493 domelem *
This = impl_from_IXMLDOMElement( iface );
1494 FIXME(
"(%p)->(%p %p)\n",
This, domAttribute, attributeNode);
1502 domelem *
This = impl_from_IXMLDOMElement( iface );
1511 XPath = is_xpathmode(get_element(
This)->doc);
1512 set_xpathmode(get_element(
This)->doc,
TRUE);
1513 query = tagName_to_XPath(tagName);
1514 hr = create_selection(get_element(
This),
query, resultList);
1516 set_xpathmode(get_element(
This)->doc, XPath);
1524 domelem *
This = impl_from_IXMLDOMElement( iface );
1529static const struct IXMLDOMElementVtbl domelem_vtbl =
1531 domelem_QueryInterface,
1534 domelem_GetTypeInfoCount,
1535 domelem_GetTypeInfo,
1536 domelem_GetIDsOfNames,
1538 domelem_get_nodeName,
1539 domelem_get_nodeValue,
1540 domelem_put_nodeValue,
1541 domelem_get_nodeType,
1542 domelem_get_parentNode,
1543 domelem_get_childNodes,
1544 domelem_get_firstChild,
1545 domelem_get_lastChild,
1546 domelem_get_previousSibling,
1547 domelem_get_nextSibling,
1548 domelem_get_attributes,
1549 domelem_insertBefore,
1550 domelem_replaceChild,
1551 domelem_removeChild,
1552 domelem_appendChild,
1553 domelem_hasChildNodes,
1554 domelem_get_ownerDocument,
1556 domelem_get_nodeTypeString,
1559 domelem_get_specified,
1560 domelem_get_definition,
1561 domelem_get_nodeTypedValue,
1562 domelem_put_nodeTypedValue,
1563 domelem_get_dataType,
1564 domelem_put_dataType,
1566 domelem_transformNode,
1567 domelem_selectNodes,
1568 domelem_selectSingleNode,
1570 domelem_get_namespaceURI,
1572 domelem_get_baseName,
1573 domelem_transformNodeToObject,
1574 domelem_get_tagName,
1575 domelem_getAttribute,
1576 domelem_setAttribute,
1577 domelem_removeAttribute,
1578 domelem_getAttributeNode,
1579 domelem_setAttributeNode,
1580 domelem_removeAttributeNode,
1581 domelem_getElementsByTagName,
1598 href = xmlchar_from_wchar(
uri);
1604 nameA = xmlchar_from_wchar(
name);
1636 nameA = xmlchar_from_wchar(
name);
1655 uriW = bstr_from_xmlChar(
ns->href);
1656 localW = bstr_from_xmlChar(
local);
1661 hr = domelem_get_qualified_item(
node, localW, uriW,
item);
1674 TRACE(
"(%p)->(%p %p)\n",
node, newItem, namedItem );
1679 if(namedItem) *namedItem =
NULL;
1683 if(!ThisNew)
return E_FAIL;
1688 if(!ThisNew->node->parent)
1689 if(xmldoc_remove_orphan(ThisNew->node->doc, ThisNew->node) !=
S_OK)
1690 WARN(
"%p is not an orphan of %p\n", ThisNew->node, ThisNew->node->doc);
1710 href = xmlchar_from_wchar(
uri);
1716 nameA = xmlchar_from_wchar(
name);
1743 ERR(
"xmlRemoveProp failed\n");
1771 curr =
node->properties;
1773 for (; attrIndex <
index && curr->
next !=
NULL; attrIndex++)
1787 for (; attrIndex <
index &&
ns->next !=
NULL; attrIndex++)
1811 hr = IUnknown_QueryInterface(unk, &IID_IXMLDOMNode, (
void**)
item);
1812 IUnknown_Release(unk);
1829 curr =
node->properties;
1850 TRACE(
"(%p)->(%d: %p)\n",
node, *iter, nextNode);
1854 curr =
node->properties;
1856 for (
i = 0;
i < *iter;
i++) {
1869static const struct nodemap_funcs domelem_attr_map = {
1870 domelem_get_named_item,
1871 domelem_set_named_item,
1872 domelem_remove_named_item,
1875 domelem_get_qualified_item,
1876 domelem_remove_qualified_item,
1880static const tid_t domelem_iface_tids[] = {
1900 This->IXMLDOMElement_iface.lpVtbl = &domelem_vtbl;
_STLP_VENDOR_CSTD::ldiv_t div(long __x, long __y)
static unsigned char bytes[4]
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static const WCHAR nameW[]
static const WCHAR valueW[]
HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound)
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa)
HRESULT WINAPI SafeArrayGetLBound(SAFEARRAY *psa, UINT nDim, LONG *plLbound)
UINT WINAPI SafeArrayGetElemsize(SAFEARRAY *psa)
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HRESULT create_element(HTMLDocumentNode *doc, const WCHAR *tag, HTMLElement **ret)
static HRESULT create_node(HTMLDocumentNode *, nsIDOMNode *, HTMLDOMNode **)
static HTMLDOMNode * get_node_obj(IHTMLDOMNode *)
static const char * debugstr_variant(const VARIANT *var)
#define cmp(status, error)
static VARIANTARG static DISPID
static HRESULT return_bstr(const WCHAR *value, BSTR *p)
#define MAKELCID(lgid, srtid)
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define IsEqualGUID(rguid1, rguid2)
static UINT encode_base64(const char *bin, unsigned int len, WCHAR *base64)
#define SUBLANG_ENGLISH_US
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
XMLPUBFUN xmlChar *XMLCALL xmlNodeGetContent(const xmlNode *cur)
XMLPUBFUN xmlAttrPtr XMLCALL xmlHasProp(const xmlNode *node, const xmlChar *name)
XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace)
XMLPUBFUN xmlChar *XMLCALL xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, xmlChar *memory, int len)
XMLPUBFUN int XMLCALL xmlRemoveProp(xmlAttrPtr cur)
XMLPUBFUN xmlChar *XMLCALL xmlGetNsProp(const xmlNode *node, const xmlChar *name, const xmlChar *nameSpace)
XMLPUBFUN void XMLCALL xmlUnlinkNode(xmlNodePtr cur)
XMLPUBFUN void XMLCALL xmlFreeProp(xmlAttrPtr cur)
XMLPUBFUN void XMLCALL xmlFreeNs(xmlNsPtr cur)
XMLPUBFUN xmlAttrPtr XMLCALL xmlHasNsProp(const xmlNode *node, const xmlChar *name, const xmlChar *nameSpace)
XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix)
XMLPUBFUN xmlChar *XMLCALL xmlSplitQName2(const xmlChar *name, xmlChar **prefix)
XMLPUBFUN xmlAttrPtr XMLCALL xmlNewNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value)
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
INT WINAPI SystemTimeToVariantTime(LPSYSTEMTIME lpSt, double *pDateOut)
_In_ DWORD _Out_ _In_ WORD wFlags
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
_In_ ULONG _In_opt_ PVOID pvData
#define DISP_E_UNKNOWNNAME
enum tagDOMNodeType DOMNodeType
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int XMLCALL xmlStrlen(const xmlChar *str)