Created
June 4, 2020 02:04
-
-
Save prabhu/b81188264748572a4a7134a907686176 to your computer and use it in GitHub Desktop.
XSLT to transform CycloneDX SBoM xml to Markdown
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
<xsl:stylesheet version="1.0" xmlns:bom="http://cyclonedx.org/schema/bom/1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="text" /> | |
<xsl:template match="/"> | |
<xsl:text>## Project dependencies</xsl:text> | |
<xsl:text>

</xsl:text> | |
<xsl:text>| Vendor | Name | Version | License Id | </xsl:text> | |
<xsl:text>
</xsl:text> | |
<xsl:text>| -------|------|---------|------------|</xsl:text> | |
<xsl:text>
</xsl:text> | |
<xsl:for-each select="/bom:bom/bom:components/bom:component"> | |
<xsl:text>| </xsl:text> | |
<xsl:value-of select="bom:group"/> | |
<xsl:text> | </xsl:text> | |
<xsl:value-of select="bom:name"/> | |
<xsl:text> | </xsl:text> | |
<xsl:value-of select="bom:version"/> | |
<xsl:text> | </xsl:text> | |
<xsl:value-of select="bom:licenses/bom:license/bom:id"/> | |
<xsl:text> |</xsl:text> | |
<xsl:text>
</xsl:text> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Author
prabhu
commented
Jun 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment