XACML 102 – Pimp my XACML – Part II: with XSLT

In my previous post on making XACML look pretty, we had a look at a very simple and easy way to add some colors / borders / general style to the XML via CSS. The CSS was interpreted by your browser and the result displayed there. CSS is simple and straightforward but it is also limited (not to mention it is probably not the most adequate tool for our purpose). The next level up is to use XSLT (part of the W3C XSL group of standards). At our level, in a very reductive and simple way, the key difference between CSS and XSLT is that CSS doesn’t touch the XML source. It merely adds style. XSLT, on the other hand, […]

Sample code screenshot - XML manipulation with XSLT

Replace an XML element value using XSLT

The aim is to take a document, look for a specific element (by local name and URI rather than name including prefix) and replace its value. Let’s have a look at how we can achieve XML manipulation with XSLT. Where is this useful? Imagine a gateway protecting an internal web service. If that web service is WS-A enabled, it therefore has a wsa:From field that contains its internal URI. Obviously the gateway abstracts the internal service from what is seen outside as a ‘virtual’ or ‘logical’ service. One, therefore, needs to update the wsa:From field to reflect an external URI. Sample XML The XSL Other uses for XML manipulation with XSLT XSLT and XML can be be used to translate […]