Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!