Skip to content

Commit

Permalink
WIP to fix artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrisc committed Jun 17, 2024
1 parent b290ad9 commit 50324d5
Show file tree
Hide file tree
Showing 8 changed files with 14,984 additions and 7,767 deletions.
File renamed without changes.
164 changes: 82 additions & 82 deletions build/ucum-oldfile.xsl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.1"
xmlns:u="http://aurora.regenstrief.org/UCUM"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>

<xsl:param name="case" select="'sensitive'"/>

<xsl:template match="/">
<xsl:text>#
# Copyright (c) 1998-2002 Regenstrief Institute. All rights reserved.
xmlns:u="http://aurora.regenstrief.org/UCUM"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<xsl:param name="case" select="'sensitive'"/>
<xsl:template match="/">
<xsl:text>#
# Copyright (c) 1998-2024 Regenstrief Institute. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -33,83 +33,83 @@
# This file is generated automatically. Please refer to the original
# UCUM specification at
#
# http://aurora.rg.iupui.edu/UCUM
# https://ucum.org
#
</xsl:text>
<xsl:text>case </xsl:text>
<xsl:value-of select="$case"/>
<xsl:text>
<xsl:text>case </xsl:text>
<xsl:value-of select="$case"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="//u:prefix"/>
<xsl:text>dimensions </xsl:text>
<xsl:value-of select="count(//u:base-unit)"/>
<xsl:text>
<xsl:apply-templates select="//u:prefix"/>
<xsl:text>dimensions </xsl:text>
<xsl:value-of select="count(//u:base-unit)"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="//u:base-unit"/>
<xsl:apply-templates select="//u:unit"/>
</xsl:template>

<xsl:template match="u:prefix">
<xsl:text>prefix </xsl:text>
<xsl:choose>
<xsl:when test="$case='insensitive'">
<xsl:value-of select="@CODE"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Code"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<xsl:value-of select="value/@value"/>
<xsl:text>
<xsl:apply-templates select="//u:base-unit"/>
<xsl:apply-templates select="//u:unit"/>
</xsl:template>
<xsl:template match="u:prefix">
<xsl:text>prefix </xsl:text>
<xsl:choose>
<xsl:when test="$case='insensitive'">
<xsl:value-of select="@CODE"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Code"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<xsl:value-of select="value/@value"/>
<xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="u:base-unit">
<xsl:text>base </xsl:text>
<xsl:choose>
<xsl:when test="$case='insensitive'">
<xsl:value-of select="@CODE"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Code"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
</xsl:template>
<xsl:template match="u:base-unit">
<xsl:text>base </xsl:text>
<xsl:choose>
<xsl:when test="$case='insensitive'">
<xsl:value-of select="@CODE"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Code"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="u:unit">
<xsl:choose>
<xsl:when test="$case='insensitive'">
<xsl:value-of select="@CODE"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Code"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> = </xsl:text>
<xsl:value-of select="value/@value"/>
<xsl:text> </xsl:text>
<xsl:value-of select="value/@Unit"/>
<xsl:choose>
<xsl:when test="@isMetric='yes'">
<xsl:text> metric </xsl:text>
</xsl:when>
<!-- xsl:when test="@isArbitrary='yes'">
</xsl:template>

<xsl:template match="u:unit">
<xsl:choose>
<xsl:when test="$case='insensitive'">
<xsl:value-of select="@CODE"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Code"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> = </xsl:text>
<xsl:value-of select="value/@value"/>
<xsl:text> </xsl:text>
<xsl:value-of select="value/@Unit"/>
<xsl:choose>
<xsl:when test="@isMetric='yes'">
<xsl:text> metric </xsl:text>
</xsl:when>
<!-- xsl:when test="@isArbitrary='yes'">
<xsl:text> arbitrary </xsl:text>
</xsl:when -->
<xsl:otherwise>
<xsl:text> nonmetric </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text> # </xsl:text>
<xsl:if test="@isArbitrary='yes'">
<xsl:text> arbitrary </xsl:text>
</xsl:when -->
<xsl:otherwise>
<xsl:text> nonmetric </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text> # </xsl:text>
<xsl:if test="@isArbitrary='yes'">
<xsl:text> arbitrary </xsl:text>
</xsl:if>
<xsl:value-of select="name"/>
<xsl:text>
</xsl:if>
<xsl:value-of select="name"/>
<xsl:text>
</xsl:text>
</xsl:template>

</xsl:template>
</xsl:transform>
Loading

0 comments on commit 50324d5

Please sign in to comment.