Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9048681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:12:54+00:00 2026-06-16T12:12:54+00:00

I’m new to xslt and have a question. I have a validate class that

  • 0

I’m new to xslt and have a question.

I have a validate class that contains all necessary setters and getters. For example it has such method:

public void setProducer(String producer) {
    this.producer = producer;
    System.out.println("TEST");
}

When I start my app I see that this method was not called.

I only see in console my test message, when I add in my xsl file such code:

<xsl:value-of name="producerName" />

So where is my mistake or xsl:variable initialized during first use?


I have this code:

<xsl:param name="category-name" />
<xsl:param name="subcategory-name" />
<xsl:param name="producer" />
<xsl:param name="model" />
<xsl:param name="color" />
<xsl:param name="date_of_issue" />
<xsl:param name="price" />
<xsl:param name="not_in_stock" />
<xsl:variable name="validator" select="validation:new()" />
<xsl:template match="/">
    <xsl:for-each select="products/category">
        <xsl:if test="name() = 'category' and @name=$category-name">
            <xsl:apply-templates select="subcategory[@name=$subcategory-name]" />
        </xsl:if>
    </xsl:for-each>
</xsl:template>

<xsl:template match="subcategory">
    <xsl:apply-templates select="good" />
    <xsl:variable name="errorSize"
        select="validation:getErrorListSize($validator)" />
    <xsl:if test="$errorSize = 0">
        <xsl:variable name="producerName"
            select="validation:setProducer($validator, $producer)" />

        <xsl:variable name="setModel"
            select="validation:setModel($validator, $model)" />
        <xsl:variable name="setColor"
            select="validation:setColor($validator, $color)" />
        <xsl:variable name="setDateOfIssue"
            select="validation:setDateOfIssue($validator, $date_of_issue)" />
        <xsl:if test="$not_in_stock != null">
            <xsl:variable name="setPrice"
                select="validation:setPrice($validator, $price)" />
        </xsl:if>
        <xsl:variable name="validationResult"
            select="validation:validateAllFields($validator)" />
        VALIDATION FINISHED
        <xsl:variable name="errors"
            select="validation:getErrorListSize($validator)" />
            <xsl:value-of select="$errors"/>

    </xsl:if>
    <xsl:if test="$errorSize != 0">
        REDIRECT. ERROR EXISTS
    </xsl:if>
</xsl:template>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T12:12:55+00:00Added an answer on June 16, 2026 at 12:12 pm

    Some XSLT processors such as Saxon use lazy evaluation, so the variable will not be evaluated untill the it’s actually needed.
    So, u haven’t use such approach, there are other possibilities to call methods.
    If variable is useless in your xsl document, use something like this instead:

    <xsl:value-of select="validation:setProducer($validator, $producer)"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I have an array which has BIG numbers and small numbers in it. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.