chore: format and slightly fix xml/xslt

This commit is contained in:
Tobias Berger 2024-02-13 11:14:56 +01:00
parent 46a6d30f70
commit 472afff0a2
Signed by: toby
GPG key ID: 2D05EFAB764D6A88
3 changed files with 28 additions and 28 deletions

View file

@ -1,24 +1,24 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- Match ModMetaData and its descendants, modify modVersion element -->
<xsl:template match="/Project/PropertyGroup/ModMetaData|ModMetaData/@*[not(name()='Id')]|ModMetaData//node()">
<xsl:copy>
<xsl:apply-templates select="@*[not(name()='Id')]|node()"/>
</xsl:copy>
</xsl:template>
<!-- Modify modVersion element using the value of VersionPrefix -->
<xsl:template match="ModMetaData/modVersion">
<modVersion>
<xsl:copy-of select="@*" />
<xsl:value-of select="/Project/PropertyGroup/VersionPrefix"/>
</modVersion>
</xsl:template>
<!-- Remove other elements and attributes -->
<xsl:template match="@*|node()">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
encoding="utf-8"
indent="yes" />
<xsl:strip-space elements="*" />
<!-- Match ModMetaData and its descendants, modify modVersion element -->
<xsl:template match="/Project/PropertyGroup/ModMetaData|ModMetaData/@*|ModMetaData//node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<!-- Modify modVersion element using the value of VersionPrefix -->
<xsl:template match="ModMetaData/modVersion">
<modVersion>
<xsl:copy-of select="@*" />
<xsl:value-of select="/Project/PropertyGroup/VersionPrefix" />
</modVersion>
</xsl:template>
<!-- Remove other elements and attributes -->
<xsl:template match="@*|node()">
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>

5
.vscode/mod.csproj vendored
View file

@ -25,8 +25,9 @@
<supportedVersions>
<li>1.4</li>
</supportedVersions>
<!-- Gets automatically populated with VersionPrefix (see above) -->
<modVersion IgnoreIfNoMatchingField="True" />
<modVersion IgnoreIfNoMatchingField="True">
<!-- Gets automatically populated with VersionPrefix (see above) -->
</modVersion>
<url />
<modDependencies />
<modDependenciesByVersion>

View file

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<packageId>dev.tobot.mod-template</packageId>
<name>Mod Template</name>
@ -9,7 +9,6 @@
<supportedVersions>
<li>1.4</li>
</supportedVersions>
<!-- Gets automatically populated with VersionPrefix (see above) -->
<modVersion IgnoreIfNoMatchingField="True">0.1.0.0</modVersion>
<url/>
<modDependencies/>