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

150
Visualizações
Converting JavaScript Function to XSLT
    var epcSum = 0;
    var labourSum = 0;
    var bvatSum = 0;
    var avatSum = 0;
    var vatSum = 0;
    var discount = 0;
    
    function addToSum(type, amount) {
        try {
            if(type=='A') epcSum += new Number(amount);
            if(type=='B') labourSum += new Number(amount);
            if(type=='C') vatSum += new Number(amount);
            if(type=='D') discount += new Number(amount);
        } catch (e) {}
        
        return '';
    }

I am not finding the way how to implement "+=" operator and using the global variable inside function . Please anybody help me to convert this javascript function to XSLT template or function.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

We need to understand the problem you are trying to solve at a higher level. You've shown us some very procedural code that relies on a function having side-effects by updating global variables. That's simply not the way a declarative, functional language like XSLT works. The XSLT code for this problem is probably easier to derive from a high-level requirements statement that from an existing low-level implementation.

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