Created
February 11, 2016 08:36
-
-
Save karronoli/1a7fa58b25fa56694dd2 to your computer and use it in GitHub Desktop.
XPath runner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Written in the D programming language | |
import std.stdio; | |
import std.file; | |
import kxml.xml; | |
void main(string[] argv) | |
{ | |
if (argv.length != 3) | |
throw new Exception("bad argument. 1st: path, 2nd: xpath"); | |
auto path = argv[1], xpath = argv[2]; | |
auto xml = readDocument(readText(path)); | |
foreach (v; xml.parseXPath(xpath)) | |
writeln(v); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "xpath-runner", | |
"description": "XPath runner", | |
"copyright": "Copyright © 2016, karronoli", | |
"authors": ["karronoli"], | |
"targetType": "executable", | |
"dflags": ["-allinst"], | |
"dependencies": { | |
"kxml": ">=1.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment