JavaScript dans une XSLT
Anass
-
dje-dje -
dje-dje -
Bonjour,
J'ai l'XSLT suivante :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl=" http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:log=" http://www.royalairmaroc.co.ma">
<xsl:output method="html" media-type="text/html; charset=ISO-8859-1"/>
<msxsl:script language="JavaScript" implements-prefix="log">
function Verifprofil(a,b)
{
if (parseInt(b) == parseInt(a))
return "1";
return "0";
}
</msxsl:script>
<xsl:template match="/">
<html>
<head><title>Services</title></head>
<body TEXT="#0000ff" bgcolor="#fffff3">
<xsl:apply-templates select="services"/>
</body>
</html>
</xsl:template>
<xsl:template match="services">
<xsl:apply-templates select="service">
<xsl:sort select="./nom"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="service">
<xsl:variable name="userp" select="3"/>
<xsl:variable name="resfunc" select="1"/>
<xsl:if test="log:Verifprofil(@profil,$userp)=$resfunc ">
<br><a href="{@lien}"><xsl:value-of select="./nom"/></a></br>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
et voici le message d'erreur que je reçois quand je veux afficher mon fichier XML selon ma feuille XSLT :
Erreur d'exécution Microsoft JScript Nombre d'arguments ou affectation de propriété incorrects line = 4, col = 8 (line is offset from the start of the script block). Error returned from property or method call.
Si vous arrivez à detecter l'erreur ou bien à trouver une solution en VBScript, faites moi signe.
Merci d'avance.
J'ai l'XSLT suivante :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl=" http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:log=" http://www.royalairmaroc.co.ma">
<xsl:output method="html" media-type="text/html; charset=ISO-8859-1"/>
<msxsl:script language="JavaScript" implements-prefix="log">
function Verifprofil(a,b)
{
if (parseInt(b) == parseInt(a))
return "1";
return "0";
}
</msxsl:script>
<xsl:template match="/">
<html>
<head><title>Services</title></head>
<body TEXT="#0000ff" bgcolor="#fffff3">
<xsl:apply-templates select="services"/>
</body>
</html>
</xsl:template>
<xsl:template match="services">
<xsl:apply-templates select="service">
<xsl:sort select="./nom"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="service">
<xsl:variable name="userp" select="3"/>
<xsl:variable name="resfunc" select="1"/>
<xsl:if test="log:Verifprofil(@profil,$userp)=$resfunc ">
<br><a href="{@lien}"><xsl:value-of select="./nom"/></a></br>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
et voici le message d'erreur que je reçois quand je veux afficher mon fichier XML selon ma feuille XSLT :
Erreur d'exécution Microsoft JScript Nombre d'arguments ou affectation de propriété incorrects line = 4, col = 8 (line is offset from the start of the script block). Error returned from property or method call.
Si vous arrivez à detecter l'erreur ou bien à trouver une solution en VBScript, faites moi signe.
Merci d'avance.
A voir également:
- JavaScript dans une XSLT
- Telecharger javascript - Télécharger - Langages
- A javascript error occurred in the main process - Forum Windows
- Afficher un tableau javascript en html ✓ - Forum Javascript
- Javascript arrondi - Forum Javascript
- Javascript arrondi après la virgule ✓ - Forum Windows