Skip to content

Instantly share code, notes, and snippets.

View jeroenroels's full-sized avatar
🏠
Working from home

Jeroen Roels jeroenroels

🏠
Working from home
View GitHub Profile
@jeroenroels
jeroenroels / transformer.xslt
Created June 21, 2023 09:33 — forked from robvitaro/transformer.xslt
Flatten an XML file to "full-xpath,value" csv file
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*[@* or not(*)] ">
<xsl:if test="not(*)">
<xsl:apply-templates select="ancestor-or-self::*" mode="path"/>
<xsl:value-of select="concat(',',.)"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>