Skip to content

Commit

Permalink
corrected p1:Type
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Apr 16, 2024
1 parent dd52f8e commit 414edde
Showing 1 changed file with 35 additions and 48 deletions.
83 changes: 35 additions & 48 deletions tools/resolve-paths.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<xsl:template match="edm:*/@Type | edm:*/@EntityType"
mode="ids">
<xsl:apply-templates select="." mode="eval-path">
<xsl:with-param name="relative-to" select="." />
<xsl:with-param name="relative-to" select=".." />
</xsl:apply-templates>
</xsl:template>

Expand Down Expand Up @@ -317,63 +317,50 @@
<xsl:with-param name="p" select="." />
</xsl:apply-templates>
</xsl:variable>
<xsl:choose>
<xsl:when test="string($path)">
<xsl:variable name="non-final-segments">
<xsl:call-template name="namespace">
<xsl:with-param name="qname" select="$path" />
<xsl:with-param name="sep" select="' '" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="final-segment">
<xsl:call-template name="name">
<xsl:with-param name="qname" select="$path" />
<xsl:with-param name="sep" select="' '" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="self::*">
<xsl:copy>
<xsl:attribute name="id">
<xsl:if test="string($path)">
<xsl:variable name="non-final-segments">
<xsl:call-template name="namespace">
<xsl:with-param name="qname" select="$path" />
<xsl:with-param name="sep" select="' '" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="final-segment">
<xsl:call-template name="name">
<xsl:with-param name="qname" select="$path" />
<xsl:with-param name="sep" select="' '" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="self::*">
<xsl:copy>
<xsl:attribute name="id">
<xsl:value-of select="generate-id()" />
</xsl:attribute>
<xsl:if test="string($non-final-segments)">
<xsl:attribute name="p0:{name()}">
<xsl:if test="string($non-final-segments)">
<xsl:attribute name="p0:{name()}">
<xsl:value-of select="$non-final-segments" />
</xsl:attribute>
</xsl:if>
<xsl:attribute name="p1:{name()}">
</xsl:if>
<xsl:attribute name="p1:{name()}">
<xsl:value-of select="$final-segment" />
</xsl:attribute>
<xsl:apply-templates select="@*|node()"
mode="ids" />
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
<xsl:if test="string($non-final-segments)">
<xsl:attribute name="p0:{name()}">
<xsl:apply-templates select="@*|node()"
mode="ids" />
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
<xsl:if test="string($non-final-segments)">
<xsl:attribute name="p0:{name()}">
<xsl:value-of select="$non-final-segments" />
</xsl:attribute>
</xsl:if>
<xsl:attribute name="p1:{name()}">
</xsl:if>
<xsl:attribute name="p1:{name()}">
<xsl:value-of select="$final-segment" />
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:if test="self::*">
<xsl:attribute name="id">
<xsl:value-of select="generate-id()" />
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@*|node()"
mode="ids" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>

<xsl:template match="*" mode="path">
Expand Down

0 comments on commit 414edde

Please sign in to comment.