mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 21:15:49 +00:00
msxml3: Support CDATA nodes in MXWriter.
This commit is contained in:
parent
ac96be9c08
commit
23c3d90866
|
@ -1143,16 +1143,26 @@ static HRESULT WINAPI SAXLexicalHandler_endEntity(ISAXLexicalHandler *iface, con
|
||||||
|
|
||||||
static HRESULT WINAPI SAXLexicalHandler_startCDATA(ISAXLexicalHandler *iface)
|
static HRESULT WINAPI SAXLexicalHandler_startCDATA(ISAXLexicalHandler *iface)
|
||||||
{
|
{
|
||||||
|
static const WCHAR scdataW[] = {'<','!','[','C','D','A','T','A','['};
|
||||||
mxwriter *This = impl_from_ISAXLexicalHandler( iface );
|
mxwriter *This = impl_from_ISAXLexicalHandler( iface );
|
||||||
FIXME("(%p): stub\n", This);
|
|
||||||
return E_NOTIMPL;
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
write_output_buffer(This->buffer, scdataW, sizeof(scdataW)/sizeof(WCHAR));
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI SAXLexicalHandler_endCDATA(ISAXLexicalHandler *iface)
|
static HRESULT WINAPI SAXLexicalHandler_endCDATA(ISAXLexicalHandler *iface)
|
||||||
{
|
{
|
||||||
mxwriter *This = impl_from_ISAXLexicalHandler( iface );
|
mxwriter *This = impl_from_ISAXLexicalHandler( iface );
|
||||||
FIXME("(%p): stub\n", This);
|
static const WCHAR ecdataW[] = {']',']','>'};
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
write_output_buffer(This->buffer, ecdataW, sizeof(ecdataW)/sizeof(WCHAR));
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI SAXLexicalHandler_comment(ISAXLexicalHandler *iface, const WCHAR *chars, int nchars)
|
static HRESULT WINAPI SAXLexicalHandler_comment(ISAXLexicalHandler *iface, const WCHAR *chars, int nchars)
|
||||||
|
|
|
@ -2905,6 +2905,60 @@ static void test_mxwriter_comment(void)
|
||||||
free_bstrs();
|
free_bstrs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_mxwriter_cdata(void)
|
||||||
|
{
|
||||||
|
ISAXContentHandler *content;
|
||||||
|
ISAXLexicalHandler *lexical;
|
||||||
|
IMXWriter *writer;
|
||||||
|
VARIANT dest;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER,
|
||||||
|
&IID_IMXWriter, (void**)&writer);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_QueryInterface(writer, &IID_ISAXLexicalHandler, (void**)&lexical);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = ISAXContentHandler_startDocument(content);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = ISAXLexicalHandler_startCDATA(lexical);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
V_VT(&dest) = VT_EMPTY;
|
||||||
|
hr = IMXWriter_get_output(writer, &dest);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
|
||||||
|
ok(!lstrcmpW(_bstr_("<![CDATA["), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest)));
|
||||||
|
VariantClear(&dest);
|
||||||
|
|
||||||
|
hr = ISAXLexicalHandler_startCDATA(lexical);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
hr = ISAXLexicalHandler_endCDATA(lexical);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
|
||||||
|
V_VT(&dest) = VT_EMPTY;
|
||||||
|
hr = IMXWriter_get_output(writer, &dest);
|
||||||
|
EXPECT_HR(hr, S_OK);
|
||||||
|
ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest));
|
||||||
|
ok(!lstrcmpW(_bstr_("<![CDATA[<![CDATA[]]>"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest)));
|
||||||
|
VariantClear(&dest);
|
||||||
|
|
||||||
|
ISAXContentHandler_Release(content);
|
||||||
|
ISAXLexicalHandler_Release(lexical);
|
||||||
|
IMXWriter_Release(writer);
|
||||||
|
free_bstrs();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(saxreader)
|
START_TEST(saxreader)
|
||||||
{
|
{
|
||||||
ISAXXMLReader *reader;
|
ISAXXMLReader *reader;
|
||||||
|
@ -2941,6 +2995,7 @@ START_TEST(saxreader)
|
||||||
test_mxwriter_startendelement();
|
test_mxwriter_startendelement();
|
||||||
test_mxwriter_characters();
|
test_mxwriter_characters();
|
||||||
test_mxwriter_comment();
|
test_mxwriter_comment();
|
||||||
|
test_mxwriter_cdata();
|
||||||
test_mxwriter_properties();
|
test_mxwriter_properties();
|
||||||
test_mxwriter_flush();
|
test_mxwriter_flush();
|
||||||
test_mxwriter_stream();
|
test_mxwriter_stream();
|
||||||
|
|
Loading…
Reference in a new issue