Created
December 25, 2016 09:26
-
-
Save dagrende/2c7e8b65ad4b38fc2fff26d7d88d2469 to your computer and use it in GitHub Desktop.
obfuscate anatomy file
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:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:variable name="fromchar" select="'abcdefghijklmnopqrstuvwABCDEFGHIJKLMNOPQRSTUVW0123456789'" /> | |
<xsl:variable name="tochar" select="'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1111111111'" /> | |
<xsl:output omit-xml-declaration="no"/> | |
<!-- copy unchanged by default --> | |
<xsl:template match="node()|@*"> | |
<xsl:copy> | |
<xsl:apply-templates select="node()|@*"/> | |
</xsl:copy> | |
</xsl:template> | |
<!-- Remove stuff --> | |
<xsl:template match="@supplier|@req|@user_1|@user_2|@user_3|@user_4|@user_5|@user_6|change-log|anatomy-document/@password|anatomy/@revisionHist|@projId|anatomyPlanner"> | |
</xsl:template> | |
<!-- Change attribute all value letters to a and digits to 1 --> | |
<xsl:template match="@alias"> | |
<xsl:attribute name="alias"> | |
<xsl:value-of select="translate(., $fromchar, $tochar)"/> | |
</xsl:attribute> | |
</xsl:template> | |
<xsl:template match="@title"> | |
<xsl:attribute name="title"> | |
<xsl:value-of select="translate(., $fromchar, $tochar)"/> | |
</xsl:attribute> | |
</xsl:template> | |
<xsl:template match="@description"> | |
<xsl:attribute name="description"> | |
<xsl:value-of select="translate(., $fromchar, $tochar)"/> | |
</xsl:attribute> | |
</xsl:template> | |
<xsl:template match="@wpResp"> | |
<xsl:attribute name="wpResp"> | |
<xsl:value-of select="translate(., $fromchar, $tochar)"/> | |
</xsl:attribute> | |
</xsl:template> | |
<xsl:template match="note/@text"> | |
<xsl:attribute name="text"> | |
<xsl:value-of select="translate(., $fromchar, $tochar)"/> | |
</xsl:attribute> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run with
java -jar apache-xalan.jar -XSL obf.xsl -IN file.ana -OUT file-obfuscated.ana