Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
How to call template on tab button onclick action in XSLT

I am trying to want to call a template on click of tab button. I have written below xsl which is currently not working.. Please let me know how I can achieve the same:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:param name="model"/>
    <xsl:param name="warningsText"/>
    <xsl:template match="/">
        <html>
            <body>
                <h1>
                    <xsl:value-of select="$model"/> model schema validation report
                </h1>
                <div>
                    <button class="tablink">
                        <xsl:attribute name="value">Error</xsl:attribute>
                        <xsl:attribute name="onclick">
                            <xsl:call-template  name="Error"/>
                        </xsl:attribute>
                    </button>
                </div>
            </body>
        </html>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want to call some function by clicking on a button - you should add JavaScript code. XSLT gives you the ability to generate HTML files from XML, but you cannot call XSLT templates from HTML output.

So your html part can be next:

<html>
<body>
<h1>
    <xsl:value-of select="$model"/>
    model schema validation report
</h1>
<div>
    <button className="tablink" value="Error" onClick="showErrorMessage()">
        The error button
    </button>
</div>
</body>
<script>
    function showErrorMessage() {
        // change code above
        alert("Hello! I am an error!!");
    }
</script>
</html>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda