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
2dfa1bff
Commit
2dfa1bff
authored
May 07, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Support attributes list for elements.
parent
b6377865
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
246 additions
and
2 deletions
+246
-2
mxwriter.c
dlls/msxml3/mxwriter.c
+37
-2
saxreader.c
dlls/msxml3/tests/saxreader.c
+209
-0
No files found.
dlls/msxml3/mxwriter.c
View file @
2dfa1bff
...
...
@@ -548,12 +548,47 @@ static HRESULT WINAPI mxwriter_saxcontent_startElement(
if
(
!
namespaceUri
||
!
local_name
||
!
QName
)
return
E_INVALIDARG
;
if
(
attr
)
FIXME
(
"attributes not handled
\n
"
);
xmlOutputBufferWriteString
(
This
->
buffer
,
"<"
);
s
=
xmlchar_from_wchar
(
QName
);
xmlOutputBufferWriteString
(
This
->
buffer
,
(
char
*
)
s
);
heap_free
(
s
);
if
(
attr
)
{
HRESULT
hr
;
INT
length
;
INT
i
;
hr
=
ISAXAttributes_getLength
(
attr
,
&
length
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
length
)
xmlOutputBufferWriteString
(
This
->
buffer
,
" "
);
for
(
i
=
0
;
i
<
length
;
i
++
)
{
const
WCHAR
*
str
;
INT
len
;
hr
=
ISAXAttributes_getQName
(
attr
,
i
,
&
str
,
&
len
);
if
(
FAILED
(
hr
))
return
hr
;
s
=
xmlchar_from_wchar
(
str
);
xmlOutputBufferWriteString
(
This
->
buffer
,
(
char
*
)
s
);
heap_free
(
s
);
xmlOutputBufferWriteString
(
This
->
buffer
,
"=
\"
"
);
hr
=
ISAXAttributes_getValue
(
attr
,
i
,
&
str
,
&
len
);
if
(
FAILED
(
hr
))
return
hr
;
s
=
xmlchar_from_wchar
(
str
);
xmlOutputBufferWriteString
(
This
->
buffer
,
(
char
*
)
s
);
heap_free
(
s
);
xmlOutputBufferWriteString
(
This
->
buffer
,
"
\"
"
);
}
}
xmlOutputBufferWriteString
(
This
->
buffer
,
">"
);
return
S_OK
;
...
...
dlls/msxml3/tests/saxreader.c
View file @
2dfa1bff
...
...
@@ -491,6 +491,211 @@ static const ISAXErrorHandlerVtbl errorHandlerVtbl =
static
ISAXErrorHandler
errorHandler
=
{
&
errorHandlerVtbl
};
static
HRESULT
WINAPI
isaxattributes_QueryInterface
(
ISAXAttributes
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
*
ppvObject
=
NULL
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ISAXAttributes
))
{
*
ppvObject
=
iface
;
}
else
{
return
E_NOINTERFACE
;
}
return
S_OK
;
}
static
ULONG
WINAPI
isaxattributes_AddRef
(
ISAXAttributes
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
isaxattributes_Release
(
ISAXAttributes
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
isaxattributes_getLength
(
ISAXAttributes
*
iface
,
int
*
length
)
{
*
length
=
2
;
return
S_OK
;
}
static
HRESULT
WINAPI
isaxattributes_getURI
(
ISAXAttributes
*
iface
,
int
nIndex
,
const
WCHAR
**
pUrl
,
int
*
pUriSize
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getLocalName
(
ISAXAttributes
*
iface
,
int
nIndex
,
const
WCHAR
**
pLocalName
,
int
*
pLocalNameLength
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getQName
(
ISAXAttributes
*
iface
,
int
nIndex
,
const
WCHAR
**
pQName
,
int
*
pQNameLength
)
{
static
const
WCHAR
attr1W
[]
=
{
'a'
,
':'
,
'a'
,
't'
,
't'
,
'r'
,
'1'
,
0
};
static
const
WCHAR
attr2W
[]
=
{
'a'
,
't'
,
't'
,
'r'
,
'2'
,
0
};
ok
(
nIndex
==
0
||
nIndex
==
1
,
"invalid index received %d
\n
"
,
nIndex
);
*
pQName
=
(
nIndex
==
0
)
?
attr1W
:
attr2W
;
*
pQNameLength
=
lstrlenW
(
*
pQName
);
return
S_OK
;
}
static
HRESULT
WINAPI
isaxattributes_getName
(
ISAXAttributes
*
iface
,
int
nIndex
,
const
WCHAR
**
pUri
,
int
*
pUriLength
,
const
WCHAR
**
pLocalName
,
int
*
pLocalNameSize
,
const
WCHAR
**
pQName
,
int
*
pQNameLength
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getIndexFromName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pUri
,
int
cUriLength
,
const
WCHAR
*
pLocalName
,
int
cocalNameLength
,
int
*
index
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getIndexFromQName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pQName
,
int
nQNameLength
,
int
*
index
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getType
(
ISAXAttributes
*
iface
,
int
nIndex
,
const
WCHAR
**
pType
,
int
*
pTypeLength
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getTypeFromName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pUri
,
int
nUri
,
const
WCHAR
*
pLocalName
,
int
nLocalName
,
const
WCHAR
**
pType
,
int
*
nType
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getTypeFromQName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pQName
,
int
nQName
,
const
WCHAR
**
pType
,
int
*
nType
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getValue
(
ISAXAttributes
*
iface
,
int
nIndex
,
const
WCHAR
**
pValue
,
int
*
nValue
)
{
static
const
WCHAR
attrval1W
[]
=
{
'a'
,
'1'
,
0
};
static
const
WCHAR
attrval2W
[]
=
{
'a'
,
'2'
,
0
};
ok
(
nIndex
==
0
||
nIndex
==
1
,
"invalid index received %d
\n
"
,
nIndex
);
*
pValue
=
(
nIndex
==
0
)
?
attrval1W
:
attrval2W
;
*
nValue
=
lstrlenW
(
*
pValue
);
return
S_OK
;
}
static
HRESULT
WINAPI
isaxattributes_getValueFromName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pUri
,
int
nUri
,
const
WCHAR
*
pLocalName
,
int
nLocalName
,
const
WCHAR
**
pValue
,
int
*
nValue
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxattributes_getValueFromQName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pQName
,
int
nQName
,
const
WCHAR
**
pValue
,
int
*
nValue
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
}
static
const
ISAXAttributesVtbl
SAXAttributesVtbl
=
{
isaxattributes_QueryInterface
,
isaxattributes_AddRef
,
isaxattributes_Release
,
isaxattributes_getLength
,
isaxattributes_getURI
,
isaxattributes_getLocalName
,
isaxattributes_getQName
,
isaxattributes_getName
,
isaxattributes_getIndexFromName
,
isaxattributes_getIndexFromQName
,
isaxattributes_getType
,
isaxattributes_getTypeFromName
,
isaxattributes_getTypeFromQName
,
isaxattributes_getValue
,
isaxattributes_getValueFromName
,
isaxattributes_getValueFromQName
};
static
ISAXAttributes
saxattributes
=
{
&
SAXAttributesVtbl
};
static
void
test_saxreader
(
void
)
{
HRESULT
hr
;
...
...
@@ -1059,6 +1264,10 @@ static void test_mxwriter_startendelement(void)
todo_wine
ok
(
!
lstrcmpW
(
_bstr_
(
"<><b></b><nspace:c/></a>"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
/* try with attributes */
hr
=
ISAXContentHandler_startElement
(
content
,
_bstr_
(
""
),
0
,
_bstr_
(
""
),
0
,
_bstr_
(
"b"
),
1
,
&
saxattributes
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISAXContentHandler_endDocument
(
content
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
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