Skip to content

Commit

Permalink
objectionary#1249: "head='tests' or head='junit'" => "head='tests'"
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed Jul 8, 2024
1 parent 101a43f commit b366e9b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SOFTWARE.
<xsl:template match="program/objects/class">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<xsl:if test="//meta[head='tests' or head='junit']">
<xsl:if test="//meta[head='tests']">
<xsl:for-each select="class//class">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SOFTWARE.
</xsl:copy>
</xsl:template>
<xsl:template match="program/objects/class/class//class">
<xsl:if test="not(//meta[head='tests' or head='junit'])">
<xsl:if test="not(//meta[head='tests'])">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SOFTWARE.
could be too long class names.
-->
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:variable name="tests" select="exists(//meta[head='junit' or head='tests'])"/>
<xsl:variable name="tests" select="exists(//meta[head='tests'])"/>
<xsl:function name="eo:name-of" as="xs:string">
<xsl:param name="class" as="node()"/>
<xsl:variable name="ret">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SOFTWARE.
<xsl:template match="class/@name">
<xsl:attribute name="name">
<xsl:choose>
<xsl:when test="//meta[head='tests' or head='junit']">
<xsl:when test="//meta[head='tests']">
<xsl:value-of select="eo:name(.)"/>
</xsl:when>
<xsl:otherwise>
Expand All @@ -61,7 +61,7 @@ SOFTWARE.
<xsl:variable name="ourRef" select="parent::o/@ref"/>
<xsl:attribute name="{name()}">
<xsl:choose>
<xsl:when test="//meta[head='tests' or head='junit']">
<xsl:when test="//meta[head='tests']">
<xsl:choose>
<xsl:when test="//class[@name=$a and @line=$ourRef]">
<xsl:value-of select="eo:name($a)"/>
Expand All @@ -81,7 +81,7 @@ SOFTWARE.
<xsl:variable name="a" select="."/>
<xsl:attribute name="{name()}">
<xsl:choose>
<xsl:when test="//meta[head='tests' or head='junit']">
<xsl:when test="//meta[head='tests']">
<xsl:choose>
<xsl:when test="//class[@name=$a]">
<xsl:value-of select="eo:name($a)"/>
Expand All @@ -100,15 +100,15 @@ SOFTWARE.
<xsl:template match="class" mode="#all">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<xsl:if test="//meta[head='tests' or head='junit']">
<xsl:if test="//meta[head='tests']">
<xsl:variable name="c" select="."/>
<xsl:apply-templates select="//class[@parent=$c/@name]" mode="copy"/>
</xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template match="objects/class[@parent]" mode="#default">
<xsl:choose>
<xsl:when test="//meta[head='tests' or head='junit']">
<xsl:when test="//meta[head='tests']">
<!-- kill them -->
</xsl:when>
<xsl:otherwise>
Expand Down

0 comments on commit b366e9b

Please sign in to comment.