-
Notifications
You must be signed in to change notification settings - Fork 10
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
Convienience methods suggestions for DOM parser #12
Comments
What would you expect a function like
Or are you looking for something else? For As for
So, I'm not sure that adding a function just to get a specific attribute really makes much sense. Also, using the subscript syntax poses two problems. First, it implies an O(1) operation, which would only be possible if over doing anything with AAs, and if a linear search is good enough, then
It will work with
which is a bit more verbose than |
I'm against adding helper functions as requested. As noted the algorithm functions already assist. I see these as just mimicing other DOM libraries and the range interface is already way better. |
"mimicking other DOM libraries", it's a bit more than that. DOM APIs are basically standarized on these names because that's what browser APIs use. Good point about the std algorithms. Perhaps it should be mentioned in a documentation :) frankly I was quite stumped after doing parseDOM(), I didn't know how to exactly extract some meaningful data out of it. |
@helikopterodaktyl, yeah the way I phrased that was harsh. I just hate the "standard" and much prefer the D standards. |
DOM parser could use some methods to simplify usage of the API:
Methods such as getElementsByTagName, getFirstChild etc.
Extraction of attributes could be made more user friendly, by adding the option to query attributes by name, something like:
DOMEntity!string entity = parseXML(
`);writeln(entity.attrs["a"]);
The text was updated successfully, but these errors were encountered: