-
I've replaced
xmllint,grepandsedwith xmlstarlet, leaving the previous use of line-based processing tools as a comment in line 20, for use on old systems.Edited by peter -
Note that the invocation of
xmlstarletabove will only work if the XML documents have set the SAML 2.0 Metadata URI as default namespace, which I ensure by curating the XML carefully:<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" ...Otherwise the XPath used by xmlstarlet would have to be changed to match whatever is the XML namespace prefix used within the metadata document, such as
md:(shown below) orns0:or whatever:- $(eval ENTITY = $(shell xmlstarlet sel -t -v '//_:EntityDescriptor/@entityID' -n $@)) + $(eval ENTITY = $(shell xmlstarlet sel -t -v '//md:EntityDescriptor/@entityID' -n $@))OTOH the example invocation for xmllint provided by @icb should work in all cases, default namespace or not.
Edited by peter
Please register or sign in to comment