-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix invalid behavior of MoveToAttribute methods #60556
Fix invalid behavior of MoveToAttribute methods #60556
Conversation
@@ -1395,6 +1386,7 @@ public override bool MoveToAttribute(string name, string? namespaceURI) | |||
return true; | |||
} | |||
_readerNav.RollBackMove(ref _curDepth); | |||
_nodeType = savedNodeType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do _curDepth
or _bInReadBinary
need any adjustments? (I've done quick tests with checking XmlReader.Depth
and that looks consistent across readers so possibly the answer is no)
@Maximys I gave this a second look and per https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmlreader.movetoattribute?view=net-6.0#System_Xml_XmlReader_MoveToAttribute_System_String_ the single string MoveToAttribute can take a qualified name while (localName, ns) does not. I.e. see implementation https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs#L1043 here - can you add tests to ensure this scenario works? (I'm not sure if it worked without this change as well so might be worth validating that as well) |
@Maximys have you perhaps had a chance to test out what I suggested above? |
@krwq , am I correctly understand you, that your want to check is next XML will read fine or not: |
@krwq question for you above |
@Maximys sorry for late response, I want you to exercise if |
@Maximys had a chance to look in the scenario I mentioned above? |
I'm going to close this due to not hearing back. Feel free to reopen if you wish to continue. |
This PR fix Issue-34443.