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

5
.vscode/mod.csproj vendored
View file

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

View file

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