Yes that is one problem (not only for diffing, but for all the other libs, too).
The road towards 1.0 is still ongoing. There should be a 0.14, soon - then the only thing left is a docs revamp, which I have planned for a long time. Unfortunately, I never found the time. Hopefully, I can do it quite soon (any contribution welcome!).
Well, the handler is obviously attached to the DOM element. But this is only reflected in memory.
Now regarding the relationship between
value as in the value prop of the DOM element will obviously reflect its current state. So this will change in AngleSharp as it does in the DOM. The
valueattribute, however, reflects the
defaultValue, which is the initial value. It won't change with any key press.
AngleSharp mimics the same; we have an initial value (read from the attribute) and an internal value, which is wired together with the DOM prop accordingly.
valueattribute/property has changed after a
onkeypress, how do I do that? Is it just through the
GetAttribute("value")method, or is that the one that points to the
defaultValue, set on the element?
var input = document.QuerySelector<IHTMLInputElement>("input#myinput"); Assert.AreEqual(input.Value, "whatever");. https://github.com/AngleSharp/AngleSharp/blob/master/src/AngleSharp/Html/Dom/IHtmlInputElement.cs#L210
Hi @jglover15 I guess not.
There is one example using the parser directly:
Otherwise in the test files you find a lot more cases:
If you would tell me what use case you have I may be able to craft a simple snippet.
XmlDocument is just a special instance of an
IDocument, so all the things such as
QuerySelectorAll still work. In general this is the idea.
In most use cases there will not be a difference to using a document that came from an
HtmlParser. There are, of course, edge cases, mostly dealing with fragment parsing, which is not well-defined for XML. But even in such cases we now have "something" and it should just work.
Could another option be to simply normalize the value of the attribute so that it's always empty or always the name of the attribute if it's truthy of simply remove the attribute if it has a falsy value?
The attribute will always reflect the attribute - this is according to the specs
If we would just change this then we would violate the specs which violates one of the core principles of AngleSharp
Hey guys, so I have this simple code
var config = Configuration.Default.WithDefaultLoader(); var context = BrowsingContext.New(config); var document = await context.OpenAsync("http://some.url/file.html");
And I am using document.QuerySelectorAll() to parse some anchor tags. These have relative links, like "file2.html".
document.BaseUri in this case is
http://some.url/file.html - is there a simple way of creating the full URL for accessing file2.html in this case? In this trivial example that would mean removing file.html and substituting file2.html - but is there a way to say "create a full URL based on this BaseURI and this relative link" that will work like a browser does?
HtmlDomBuilder#HeisenbergAlgorithmkeeps coming up, googling HeisenbergAlgorithm does not bring anything related up, would someone be able to point me in the right place that explains what its doing.