Skip to content

Commit

Permalink
mode="path-remainder"
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Apr 16, 2024
1 parent d64ebeb commit 4724f00
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions tools/resolve-paths.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,12 @@
<xsl:with-param name="qname" select="$q" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="top"
<xsl:apply-templates
select="//edm:Schema[@Alias=$namespace or @Namespace=$namespace]
/*[@Name=$name]" />
<xsl:value-of select="generate-id($top)" />
<xsl:if test="contains($p,'/')">
<xsl:text> </xsl:text>
<xsl:apply-templates select="$top" mode="path">
<xsl:with-param name="p"
select="substring-after($p,'/')" />
</xsl:apply-templates>
</xsl:if>
/*[@Name=$name]"
mode="path-remainder">
<xsl:with-param name="p" select="$p" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="@Type | @EntityType">
<xsl:variable name="type">
Expand Down Expand Up @@ -428,29 +423,30 @@
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$q='$ReturnType'">
<xsl:value-of select="generate-id(edm:ReturnType)" />
<xsl:if test="contains($p,'/')">
<xsl:text> </xsl:text>
<xsl:apply-templates select="edm:ReturnType"
mode="path">
<xsl:with-param name="p"
select="substring-after($p,'/')" />
</xsl:apply-templates>
</xsl:if>
<xsl:apply-templates select="edm:ReturnType"
mode="path-remainder">
<xsl:with-param name="p" select="$p" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="member" select="*[@Name=$q]" />
<xsl:value-of select="generate-id($member)" />
<xsl:if test="contains($p,'/')">
<xsl:text> </xsl:text>
<xsl:apply-templates select="$member"
mode="path">
<xsl:with-param name="p"
select="substring-after($p,'/')" />
</xsl:apply-templates>
</xsl:if>
<xsl:apply-templates select="*[@Name=$q]"
mode="path-remainder">
<xsl:with-param name="p" select="$p" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="*" mode="path-remainder">
<xsl:param name="p" />
<xsl:value-of select="generate-id()" />
<xsl:if test="contains($p,'/')">
<xsl:text> </xsl:text>
<xsl:apply-templates select="." mode="path">
<xsl:with-param name="p"
select="substring-after($p,'/')" />
</xsl:apply-templates>
</xsl:if>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 4724f00

Please sign in to comment.