Skip to content

Instantly share code, notes, and snippets.

@stelf
Created January 11, 2024 23:16
Show Gist options
  • Save stelf/1f5f5046e9754c48950149a1c5198b1d to your computer and use it in GitHub Desktop.
Save stelf/1f5f5046e9754c48950149a1c5198b1d to your computer and use it in GitHub Desktop.
strip VisionR schema
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Template to process objectdefs and descend into module_name/objectdef/objectprop and match metaprops -->
<xsl:template match="import | objectdefs | objectdefs/* | objectdefs/*/* | objectdefs/*/*/* ">
<xsl:copy>
<xsl:apply-templates select="*"/>
</xsl:copy>
</xsl:template>
<!-- Template to match specific meta-properties within objectprop and copy them -->
<xsl:template match="category | sort_id | is_inmaintbl | data_source | is_foreignkey | related_objectdef | is_obligatory | index_code | value_table | data_type">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<!-- Ignore other elements at the objectprop level -->
<xsl:template match="objectdefs/*/*/*/*" priority="-1"/>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment