Category: XML
-
converting a Jenkins CI job’s config.xml to several flat files (.properties, .sh, .bat, …)
Over time Jenkins jobs can grow into something “a little confusing”, in other words: like cancer. The Jenkins developers were thoughtful enough to provide an API to all the data structures, that Jenkins and its jobs operate on, so we are able to export an entire Jenkins job as XML. You certainly do not want…
-
once you are getting familiar with XPath and XMLStarlet, you are using it for rather “ordinary tasks”
http://xmlstar.sourceforge.net https://www.cygwin.com – “Get that Linux feeling – on Windows“ https://cygwin.com/cgi-bin2/package-grep.cgi?grep=xmlstarlet http://www.finkproject.org – “The Fink project wants to bring the full world of Unix Open Source software to Darwin and Mac OS X. …“ http://pdb.finkproject.org/pdb/package.php/xmlstarlet Areas, where you will want to make use of XPath expressions and xmlstarlet in order to extract details: HTML web pages –…
-
using XPath on non-XML HTML – how to tidy dirty HTML?
Scraping HTML using XPath is far nicer than through low-level text processing. But how to proceed, if your XPath tool cannot deal with the HTML, because it is not XHTML conform resp. properly formatted XML? My XPath tool is XMLStarlet: And it can also help reformatting HTML, so that XPath expressions can get applied. I…
-
Q: how to get updates from web pages w/o RSS feed? A: XPath + cron or Jenkins job
sadly enough even now in 2016 a lot of web pages are not XHTML conform, but getting them fairly conform is not that expensive: use “xmlstarlet fo –html –recover“ get the (cron or) Jenkins job to save the current page content in the job’s workspace let the Jenkins job compare the current to the last…
-
Jenkins: how to authenticate as a scripted client?
https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients To make scripted clients (such as wget) invoke operations that require authorization (such as scheduling a build), use HTTP BASIC authentication to specify the user name and the API token. This is often more convenient than emulating the form-based authentication. The article quote above mentions “buildToken“, but I don’t need it at all. The…
-
Python and XPath
I had done some XPath using XMLStarlet in a shell script, and I quite like it. Feeling “safe enough” with XPath I managed to deal with the Python XPath pitfall(s), and I quite like my 1st respective XPath Python script. And of course my Python script has a nicer CLI interface than my shell script.…
-
XMLStarlet – a command-line utility to deal with XML documents
https://en.wikipedia.org/wiki/XMLStarlet https://de.wikipedia.org/wiki/XMLStarlet http://xmlstar.sourceforge.net http://xmlstar.sourceforge.net/docs.php http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html – User’s Guide http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139502176 – the User’s Guide section on “Other XmlStarlet Resources” (with a few broken links) http://xmlstar.sourceforge.net/doc/xmlstarlet.txt – yet another document called “User’s Guide” but with more rather educative examples http://www.ibm.com/developerworks/library/x-starlet http://www.heise.de/ct/inhalt/15/14/172 — behind a paywall; my PDF copy lives on my archive at: Computers/Data_Formats/Markup_Languages/XML/Addressing_and_Querying/XPath/ http://www.freesoftwaremagazine.com/articles/xml_starlet CAVEAT: “xmlstarlet sel –template –value-of XPATH” lists all…
-
the GNU packages that I need most seriously on my “finkified” Macs
https://wiki.jochen.hayek.name/w?title=The_GNU_packages_that_I_need_most_seriously_on_my_finkified_Macs – this is where this text should actually live and get maintained CAVEAT!!! Read carefully beforehand: http://finkproject.org/download/ http://finkproject.org/download/srcdist.php I.e. install Xcode Tools/Developer Tools, Xcode Command Line Tools, and X11 ! This message wants to tell you, that the Xquartz X11 distribution is not installed (it is not something, that fink can do for you):…
-
updating resp. re-installing “fink” on OS X “El Capitan”
Updating did not work at all. I needed a fresh installation from finkproject.org . And then: $ fink install coreutils xmlstarlet pwgen $ fink install xpdf … Nota bene: you should always upgrade fink before upgrading OS X.