XSLT

1 program Added 2025-10-23T09:46:55Z Model: x-ai/grok-4-fastTemp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit 7628eb398c · authored 2025-10-23T11:46:55+02:00 · model x-ai/grok-4-fast

Sources mentioning this language

8 sources · pl_id: pl/xslt
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q32110

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsdeclarative
Designed byWorld Wide Web Consortium (W3C)
First appeared1998
Influenced byDSSSL
Homepagehttps://www.w3.org/TR/xslt-30/

Extensions claimed by this language

7 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.xslpygmentsprimary1.8M files
.xslwikidataprimary1.8M files
.xsltlinguistprimary217.5K files
.xsltwikidataprimary217.5K files
.xplpygmentssecondary34.5K files
.xsllinguistsecondary1.8M files
.xsltpygmentssecondary217.5K files

Related languages

Bolt (0.20)Volt (0.20)Quilt (0.18)Vault (0.18)Xcerpt (0.17)

LLM-contributed programs

CD Collection to HTML Table Transformer

Provenance: commit 7628eb398c · authored 2025-10-23T11:46:55+02:00 · model x-ai/grok-4-fast · Temp 0.4
code.xsl · added: 2025-10-23T09:46:55Z
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
  <h2>My CD Collection</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Title</th>
        <th>Artist</th>
      </tr>
      <xsl:for-each select="catalog/cd">
      <tr>
        <td><xsl:value-of select="title"/></td>
        <td><xsl:value-of select="artist"/></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

Real programs from Software Heritage

2 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
gtester-to-junit.xslt · 3420 B · ext .xslt · seen 190× in SWH
via unique-primary
swh:1:cnt:c7a5f1c53d9816cf3cd911314a8d0b0b1374663b;origin=https://github.com/cwarden/mysql-proxy;anchor=swh:1:rev:9bf05eb6e5f5e3545119cc13dd9d8764c526a1af;path=/tests/gtester-to-junit.xslt
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
<!-- $%BEGINLICENSE%$
 Copyright (c) 2008, Oracle and/or its affiliates. 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 the Free Software Foundation; version 2 of the
 License.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 02110-1301  USA

 $%ENDLICENSE%$ -->
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!--
        jsled@mysql.com, 2008-06-17.  Convert mysql-lb's gtester output into
        junit-style report xml for hudson to consume.
    -->
    <xsl:output method="xml" cdata-section-elements="system-out system-err failure" indent="yes"/>
    <xsl:template match="/gtester/testbinary/testcase">
        <testcase>
            <xsl:attribute name="time">
                <xsl:value-of select="./duration/text()"/>
            </xsl:attribute>
            <xsl:attribute name="classname">
                <xsl:value-of select="concat('com.mysql.proxy.', translate(../@path, '/', '_'))"/>
            </xsl:attribute>
            <!-- translate some names (above and below) to try and get
                 somewhat closer to java-style package names, which hudson
                 keys off of for the ui -->
            <xsl:attribute name="name">
                <xsl:value-of select="translate(@path, '/-', '_')"/>
            </xsl:attribute>
            <xsl:if test="./status[@result='failed']">
                <failure>
                    <xsl:apply-templates select="./error"/>
                </failure>
            </xsl:if>
        </testcase><xsl:text>
</xsl:text>
    </xsl:template>
    <!-- what a convoluted way to say "or". :( -->
    <xsl:template match="/gtester/testbinary/testcase/child::*[self::error or self::message]">
        <xsl:value-of select="./text()"/>
        <xsl:text>
</xsl:text>
    </xsl:template>
    <xsl:template match="text()"/>
    <xsl:template match="/">
        <testsuite errors="0" failures="0" name="com.mysql.proxy.testsuite.All">
            <xsl:attribute name="time">
                <xsl:value-of select="./gtester/testbinary/duration"/>
            </xsl:attribute>
            <xsl:attribute name="tests">
                <xsl:value-of select="count(/gtester/testbinary/testcase)"/>
            </xsl:attribute>
            <xsl:attribute name="failures">
                <xsl:value-of select="count(/gtester/testbinary/testcase/status[@result=&quot;failed&quot;])"/>
            </xsl:attribute>
<xsl:text>
</xsl:text>
            <xsl:apply-templates select="/gtester/testbinary/testcase"/>
            <system-out><xsl:text>
</xsl:text>
                <xsl:apply-templates select="/gtester/testbinary/testcase/message"/>
            </system-out>
            <system-err><xsl:text>
</xsl:text>
                <xsl:apply-templates select="/gtester/testbinary/testcase/error"/>
            </system-err>
        </testsuite>
    </xsl:template>
</xsl:stylesheet>
MessageConstantsGenerator.xslt · 4429 B · ext .xslt · seen 61× in SWH
via unique-primary
swh:1:cnt:b783cc9aee1a2b38390d8a3ad607f17cfee0a102;origin=https://github.com/anaptecs/jeaf-generator;anchor=swh:1:rev:5fa37c443fc40a99ccccccbf23c742d79558ac9d;path=/jeaf-message-constants-generator/src/main/resources/MessageConstantsGenerator.xslt
Open in SWH · Raw bytes (SWH) · GitHub raw
Reviews (ground truth · how?)
👤 mathieu-acherpl/xslt (medium) 2026-06-12
seems used for generating Java (template)
Show source
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
     Stylesheet defines the transformation of an XML document that has the 
     structure that is defined in DTD MessageData.dtd. Through this templates
     java classes containing constants for all contained messages can be 
     generated.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">




<!-- Define output type of template -->
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>




<!-- Define public parameters -->
<xsl:param name="RESOURCE_NAME"/>
	



<!-- 
     Template for root element. This template is the starting point for the 
	 class generation. The template is exceuted due to an build in template 
	 rule
-->
<xsl:template match="Root">package <xsl:value-of select="ClassInfo/@package"/>;
import com.anaptecs.jeaf.xfun.annotations.MessageResource;
/**
 * <xsl:value-of select="ClassInfo/@description"/>
 *
 * @author <xsl:value-of select="ClassInfo/@author"/>
 * @version <xsl:value-of select="ClassInfo/@version"/>
 */
@MessageResource(path = "<xsl:value-of select="$RESOURCE_NAME"/>")
public final class <xsl:value-of select="ClassInfo/@className"/> {
  /**
   * Constant for XML file that contains all messages that are defined within this class.
   */
  private static final String MESSAGE_RESOURCE = "<xsl:value-of select="$RESOURCE_NAME"/>";
  <xsl:apply-templates select="//Message"/>
  <xsl:call-template name="GenerateStaticInitializer">
  <xsl:with-param name="test" select="'Testvalue'"/></xsl:call-template>}
</xsl:template>
	



<!-- 
     Template is used for the generation of a single constant for each message 
	 element. The template is only applied on message elements which have the
	 type INFO.
-->
<xsl:template match="Message[@type='INFO']">
  /**
   * <xsl:value-of select="@description"/>
   */
  <xsl:choose>
  	<xsl:when test="@deprecated = 'TRUE'">@Deprecated</xsl:when>
  </xsl:choose>
  public static final com.anaptecs.jeaf.xfun.api.messages.MessageID <xsl:value-of select="@name"/>;
</xsl:template>
	



<!-- 
     Template is used for the generation of a single constant for each message 
	 element. The template is only applied on message elements which have the
	 type ERROR.
-->
<xsl:template match="Message[@type='ERROR']">
  /**
   * <xsl:value-of select="@description"/>
   */
  <xsl:choose>
  	<xsl:when test="@deprecated = 'TRUE'">@Deprecated</xsl:when>
  </xsl:choose>
  public static final com.anaptecs.jeaf.xfun.api.errorhandling.ErrorCode <xsl:value-of select="@name"/>;
</xsl:template>
	



<!-- 
     Template is used for the generation of a single constant for each message 
	 element. The template is only applied on message elements which have the
	 type ERROR.
-->
<xsl:template match="Message[@type='LOCALIZED_STRING']">
  /**
   * <xsl:value-of select="@description"/>
   */
  <xsl:choose>
  	<xsl:when test="@deprecated = 'TRUE'">@Deprecated</xsl:when>
  </xsl:choose>
  public static final com.anaptecs.jeaf.xfun.api.messages.LocalizedString <xsl:value-of select="@name"/>;
</xsl:template>
	



<!--
     Template generates the static initialzer where all the generated constants 
     are initialized.
-->
<xsl:template name="GenerateStaticInitializer">
  /**
   * Static initializer contains initialization for all generated constants.
   */
  static {
    com.anaptecs.jeaf.xfun.api.messages.MessageRepository lRepository = com.anaptecs.jeaf.xfun.api.XFun.getMessageRepository();
    lRepository.loadResource(MESSAGE_RESOURCE);
    
    // Handle all info messages.
    <xsl:for-each select="//Message[@type='INFO']">
    <xsl:value-of select="@name"/> = lRepository.getMessageID(<xsl:value-of select="@messageID"/>);
    </xsl:for-each>

    // Handle all messages for errors.
    <xsl:for-each select="//Message[@type='ERROR']">
    <xsl:value-of select="@name"/> = lRepository.getErrorCode(<xsl:value-of select="@messageID"/>);
    </xsl:for-each>
    
    // Handle all localized strings.
    <xsl:for-each select="//Message[@type='LOCALIZED_STRING']">
    <xsl:value-of select="@name"/> = lRepository.getLocalizedString(<xsl:value-of select="@messageID"/>);
    </xsl:for-each>
  }
  
  /**
   * Constructor is private to ensure that no instances of this class will be created.
   */
  private <xsl:value-of select="ClassInfo/@className"/>() {
    // Nothing to do.
  }
</xsl:template>



<!--
     End of stylesheet.
-->
</xsl:stylesheet>
 

Contribute — propose a file extension

Tell us where to find evidence about XSLT (mapped to pl/xslt). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/XSLT/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← XSL XSM →