Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d9fc6985
Commit
d9fc6985
authored
Jan 14, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Jan 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml: Implement getAttribute.
parent
7439c29d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
element.c
dlls/msxml3/element.c
+25
-3
domdoc.c
dlls/msxml3/tests/domdoc.c
+20
-0
No files found.
dlls/msxml3/element.c
View file @
d9fc6985
...
...
@@ -454,10 +454,32 @@ static HRESULT WINAPI domelem_get_tagName(
static
HRESULT
WINAPI
domelem_getAttribute
(
IXMLDOMElement
*
iface
,
BSTR
p
,
VARIANT
*
var
)
BSTR
name
,
VARIANT
*
value
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
domelem
*
This
=
impl_from_IXMLDOMElement
(
iface
);
xmlNodePtr
element
;
xmlChar
*
xml_name
,
*
xml_value
;
HRESULT
hr
=
E_FAIL
;
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_w
(
name
),
value
);
element
=
get_element
(
This
);
if
(
!
element
)
return
E_FAIL
;
VariantInit
(
value
);
xml_name
=
xmlChar_from_wchar
(
name
);
xml_value
=
xmlGetNsProp
(
element
,
xml_name
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
xml_name
);
if
(
xml_value
)
{
V_VT
(
value
)
=
VT_BSTR
;
V_BSTR
(
value
)
=
bstr_from_xmlChar
(
xml_value
);
xmlFree
(
xml_value
);
hr
=
S_OK
;
}
return
hr
;
}
static
HRESULT
WINAPI
domelem_setAttribute
(
...
...
dlls/msxml3/tests/domdoc.c
View file @
d9fc6985
...
...
@@ -71,6 +71,7 @@ static const WCHAR szOpen[] = { 'o','p','e','n',0 };
static
const
WCHAR
szdl
[]
=
{
'd'
,
'l'
,
0
};
static
const
WCHAR
szlc
[]
=
{
'l'
,
'c'
,
0
};
static
const
WCHAR
szbs
[]
=
{
'b'
,
's'
,
0
};
static
const
WCHAR
szstr1
[]
=
{
's'
,
't'
,
'r'
,
'1'
,
0
};
void
test_domdoc
(
void
)
{
...
...
@@ -312,6 +313,25 @@ void test_domnode( void )
ok
(
!
lstrcmpW
(
str
,
szlc
),
"incorrect nodeName
\n
"
);
SysFreeString
(
str
);
str
=
SysAllocString
(
szNonExistentFile
);
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
0x1234
;
r
=
IXMLDOMElement_getAttribute
(
element
,
str
,
&
var
);
ok
(
r
==
E_FAIL
,
"getAttribute ret %08lx
\n
"
,
r
);
ok
(
V_VT
(
&
var
)
==
VT_EMPTY
,
"vt = %x
\n
"
,
V_VT
(
&
var
));
VariantClear
(
&
var
);
SysFreeString
(
str
);
str
=
SysAllocString
(
szdl
);
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
0x1234
;
r
=
IXMLDOMElement_getAttribute
(
element
,
str
,
&
var
);
ok
(
r
==
S_OK
,
"getAttribute ret %08lx
\n
"
,
r
);
ok
(
V_VT
(
&
var
)
==
VT_BSTR
,
"vt = %x
\n
"
,
V_VT
(
&
var
));
ok
(
!
lstrcmpW
(
V_BSTR
(
&
var
),
szstr1
),
"wrong attr value
\n
"
);
VariantClear
(
&
var
);
SysFreeString
(
str
);
r
=
IXMLDOMElement_get_attributes
(
element
,
&
map
);
ok
(
r
==
S_OK
,
"get_attributes returned wrong code
\n
"
);
ok
(
map
!=
NULL
,
"should be attributes
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment