On Friday, 6 February 2015 at 09:15:54 UTC, Derix wrote:
So, I set sails to transform a bunch of HTML files with D. This, of course, will happen with the std.xml library.

There is this nice example :
http://dlang.org/phobos/std_xml.html#.DocumentParser
that I put to some use already, however some of the basics seem to escape me, specially in lines like

    xml.onEndTag["author"]       = (in Element e) { book.author
   = e.text(); };

OK, we're doing some event-base parsing, reacting with a lambda function on encountering so-and-do tag, à la SAX. (are we ?)

What I don't quite grab is the construct (in Element e) , especially the *in* part.

Is it *in* as in http://dlang.org/expression.html#InExpression ? In which case I fail to see what associative array we're considering.

It's probably more a way to further qualify the argument e were passing to the λ-function : could someone elaborate on that ?

Of course, it is entirely possible that I completely miss the point and that I'm overlooking some fundamentals, if so have mercy and help me find my way back to teh righteous path ;-)


Thxxx

Maybe, when you're on windows, you could use msxml6 through COM.
You have DOM, SAX, Xpath 1.0 and XSLT at your disposal.

Reply via email to