Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36686
-- v3: msxml3: Add normalize-line-breaks sax feature. msxml3/tests: Fix schema-validation sax feature tests.
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/msxml3/tests/saxreader.c | 2 +- dlls/msxml6/tests/saxreader.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 9aa5ecf6782..98da879f886 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2878,7 +2878,7 @@ static void test_saxreader_features(void) hr = ISAXXMLReader_getFeature(reader, _bstr_("schema-validation"), &value); ok(hr == S_OK, "Failed to get feature value, hr %#lx.\n", hr); ok(value == VARIANT_FALSE, "Unexpected default feature value.\n"); - hr = ISAXXMLReader_putFeature(reader, _bstr_("exhaustive-errors"), VARIANT_FALSE); + hr = ISAXXMLReader_putFeature(reader, _bstr_("schema-validation"), VARIANT_FALSE); ok(hr == S_OK, "Failed to put feature value, hr %#lx.\n", hr); } else diff --git a/dlls/msxml6/tests/saxreader.c b/dlls/msxml6/tests/saxreader.c index 52da4ef4460..2e2faf2ad42 100644 --- a/dlls/msxml6/tests/saxreader.c +++ b/dlls/msxml6/tests/saxreader.c @@ -4636,7 +4636,7 @@ static void test_saxreader_features(void) hr = ISAXXMLReader_getFeature(reader, _bstr_("schema-validation"), &value); ok(hr == S_OK, "Failed to get feature value, hr %#lx.\n", hr); ok(value == VARIANT_FALSE, "Unexpected default feature value.\n"); - hr = ISAXXMLReader_putFeature(reader, _bstr_("exhaustive-errors"), VARIANT_FALSE); + hr = ISAXXMLReader_putFeature(reader, _bstr_("schema-validation"), VARIANT_FALSE); ok(hr == S_OK, "Failed to put feature value, hr %#lx.\n", hr);
name = feature_names;
From: Vijay Kiran Kamuju infyquest@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36686 --- dlls/msxml3/saxreader.c | 10 ++++++++-- dlls/msxml3/tests/saxreader.c | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 0daf6d8425d..f52bc6b6806 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -60,7 +60,8 @@ typedef enum SuppressValidationfatalError = 1 << 12, UseInlineSchema = 1 << 13, UseSchemaLocation = 1 << 14, - LexicalHandlerParEntities = 1 << 15 + LexicalHandlerParEntities = 1 << 15, + NormalizeLineBreaks = 1 << 16 } saxreader_feature;
struct saxreader_feature_pair @@ -76,6 +77,7 @@ static const struct saxreader_feature_pair saxreader_feature_map[] = { { LexicalHandlerParEntities, L"http://xml.org/sax/features/lexical-handler/parameter-entities" }, { NamespacePrefixes, L"http://xml.org/sax/features/namespace-prefixes" }, { Namespaces, L"http://xml.org/sax/features/namespaces" }, + { NormalizeLineBreaks, L"normalize-line-breaks" }, { ProhibitDTD, L"prohibit-dtd" }, { SchemaValidation, L"schema-validation" }, }; @@ -3190,6 +3192,9 @@ static HRESULT WINAPI isaxxmlreader_getFeature( if (This->version < MSXML4 && (feature == ExhaustiveErrors || feature == SchemaValidation)) return E_INVALIDARG;
+ if (This->version >= MSXML4 && feature == NormalizeLineBreaks) + return E_INVALIDARG; + if (feature == Namespaces || feature == NamespacePrefixes || feature == ExhaustiveErrors || @@ -3224,7 +3229,8 @@ static HRESULT WINAPI isaxxmlreader_putFeature( if (feature == LexicalHandlerParEntities || feature == ProhibitDTD || feature == ExternalGeneralEntities || - feature == ExternalParameterEntities) + feature == ExternalParameterEntities || + feature == NormalizeLineBreaks ) { FIXME("(%p)->(%s %x) stub\n", This, debugstr_w(feature_name), value); return set_feature_value(This, feature, value); diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 98da879f886..9a33f049807 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2880,6 +2880,11 @@ static void test_saxreader_features(void) ok(value == VARIANT_FALSE, "Unexpected default feature value.\n"); hr = ISAXXMLReader_putFeature(reader, _bstr_("schema-validation"), VARIANT_FALSE); ok(hr == S_OK, "Failed to put feature value, hr %#lx.\n", hr); + + value = 123; + hr = ISAXXMLReader_getFeature(reader, _bstr_("normalize-line-breaks"), &value); + ok(hr == E_INVALIDARG, "Failed to get feature value, hr %#lx.\n", hr); + ok(value == 123, "Unexpected value %d.\n", value); } else { @@ -2892,6 +2897,13 @@ static void test_saxreader_features(void) hr = ISAXXMLReader_getFeature(reader, _bstr_("schema-validation"), &value); ok(hr == E_INVALIDARG, "Failed to get feature value, hr %#lx.\n", hr); ok(value == 123, "Unexpected value %d.\n", value); + + value = VARIANT_FALSE; + hr = ISAXXMLReader_getFeature(reader, _bstr_("normalize-line-breaks"), &value); + todo_wine ok(hr == S_OK, "Failed to get feature value, hr %#lx.\n", hr); + todo_wine ok(value == VARIANT_TRUE, "Unexpected default feature value.\n"); + hr = ISAXXMLReader_putFeature(reader, _bstr_("normalize-line-breaks"), VARIANT_TRUE); + ok(hr == S_OK, "Failed to put feature value, hr %#lx.\n", hr); }
name = feature_names;
On Mon Nov 17 22:49:55 2025 +0000, Vijay Kiran Kamuju wrote:
Ok, I will move it below for the putFeature, so that we will print as stub for that feature so its not ignored and tests now have todo_wine. Please review.
This feature presumably affects output data, I don't think pretending that we support it is good enough.
On Tue Nov 18 15:32:49 2025 +0000, Nikolay Sivov wrote:
This feature presumably affects output data, I don't think pretending that we support it is good enough.
This feature is enabled by default to True by default in MSXML3. This feature surely affects output data, this feature normalizes cr-lf sequence to cr. Setting this feature is disabled since MSXML4 and is always enabled. Hence I think we can pretend to support it for now.
https://learn.microsoft.com/en-us/previous-versions/windows/embedded/ms88584...)
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ms753751...