Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda