-
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
Nullable: System.Xml, part 6 (XSLT minus XSLT.Runtime) #40368
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/AbsoluteQuery.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilValidationVisitor.cs
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/SubstitutionList.cs
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlQueryCardinality.cs
Show resolved
Hide resolved
string uriString = (string)info.GetValue("Uri", typeof(string))!; | ||
int startLine = (int)info.GetValue("StartLine", typeof(int))!; | ||
int startPos = (int)info.GetValue("StartPos", typeof(int))!; | ||
int endLine = (int)info.GetValue("EndLine", typeof(int))!; | ||
int endPos = (int)info.GetValue("EndPos", typeof(int))!; |
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.
What ensures that info.GetValue
will never be null?
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.
This .ctor is only referenced by another internal .ctor in XPathCompileException
which shows zero references so this might as well be dead code.
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.
I think those might be used by BinaryFormatter. I'd refrain from touching this. While technically payload can be tampered, in normal case you will get only what you wrote which should not affect annotation.
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.
Left some questions on public API annotations.
src/libraries/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs
Show resolved
Hide resolved
{ | ||
if (input == null) | ||
{ | ||
throw new ArgumentNullException(nameof(input)); | ||
} | ||
return Transform(input.CreateNavigator(), args, resolver); | ||
return Transform(input.CreateNavigator()!, args, resolver); |
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.
These node types can return null:
runtime/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlDocument.cs
Lines 781 to 786 in a34177e
case XmlNodeType.EntityReference: | |
case XmlNodeType.Entity: | |
case XmlNodeType.DocumentType: | |
case XmlNodeType.Notation: | |
case XmlNodeType.XmlDeclaration: | |
return null; |
Could that cause an issue later on this code?
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.
theoretically yes but it's not expected to pass any of these here so it should produce the error - perhaps error could be better... Not sure how would transformation work on say EntityReference... it only make sense for document or element and perhaps some kind of text node (even that would be a stretch)
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.
note this class is Obsolete anyway so I wouldn't even bother filing issue on this
src/libraries/System.Private.Xml/src/System/Xml/Xslt/XsltArgumentList.cs
Outdated
Show resolved
Hide resolved
hmm, I'm not getting these build errors locally, will try rebasing |
src/libraries/System.Private.Xml/src/System/Xml/Xslt/XsltContext.cs
Outdated
Show resolved
Hide resolved
Thanks @jozkee! |
ref: #2339 |
💯 Awesome!!! |
XSLT minus:
*XPath*
files which @jozkee currently works on