Skip Menu |

This queue is for tickets about the XML-XSLT CPAN distribution.

Report information
The Basics
Id: 16312
Status: resolved
Priority: 0/
Queue: XML-XSLT

People
Owner: jns [...] gellyfish.co.uk
Requestors: jonathan.schaeffer [...] in2p3.fr
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: xslt parsing's wrong behaviour
I came accross an error in transalation behaviour. The value of each <xsl:value-of /> markup is the same when using this module but the output is what I would expect using xsltproc. Here are the concerned files. Using this style-sheet : <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/JOB"> #!/bin/sh <!-- UserEmail est a Ajouter dans le code de bqs.pm --> <xsl:if test="ATTR[@name='UserEmail']/@value" > #PBS -mu <xsl:value-of select="ATTR[@name='UserEmail']/@value"/> </xsl:if> <xsl:if test="JOB/ATTR[@name='bqsQueueName']/@value" > #PBS -q <xsl:value-of select="ATTR[@name='bqsQueueName']/@value"/> </xsl:if> <xsl:if test="ATTR[@name='bqsQueueMaxAllowedMemory']/@value" > #PBS -l M=<xsl:value-of select="ATTR[@name='bqsQueueMaxAllowedMemory']/@value"/> </xsl:if> <xsl:if test="ATTR[@name='bqsQueueMaxCPUTime']/@value" > #PBS -l T=<xsl:value-of select="ATTR[@name='bqsQueueMaxCPUTime']/@value"/> </xsl:if> <xsl:if test="ATTR[@name='bqsQueueMaxAllowedScratch']/@value" > #PBS -l scratch=<xsl:value-of select="ATTR[@name='bqsQueueMaxAllowedScratch']/@value"/> </xsl:if> <xsl:if test="ATTR[@name='bqsQueueMaxCPUTime']/@value" > #PBS -l platform=<xsl:value-of select="ATTR[@name='bqsQueueMaxCPUTime']/@value"/> </xsl:if> <!-- Cette ligne doit etre calculee en fonction de la conf de la VO en question : select="ATTR[@name ='localGroupName']/@value --> #PBS -l LCG= <xsl:if test="ATTR[@name='gridUserId']/@value"> # # Grid User Id : '<xsl:value-of select="ATTR[@name='gridUserId']/@value"/> # </xsl:if> </xsl:template> <xsl:template match="ATTR[@name='bqsQueueName']" > #PBS -PLOP <xsl:value-of select="@value"/> </xsl:template> </xsl:stylesheet> ------------------- And this is my XML file to parse : <JOB><ATTR name="bqsCluster" value="lcg"/><ATTR name="bqsQueueName" value="A"/><ATTR name="bqsQueueMaxAllowedMemory" value="512"/><ATTR name="bqsQueueMaxCPUTime" value="500"/><ATTR name="bqsQueueMaxAllowedScratch" value="1025"/><ATTR name="gridUserId" value="/O=GRID-FR/C=FR/O=CNRS/OU=CC-LYON/CN=Jonathan Schaeffer/Email=jonathan.schaeffer@cc.in2p3.fr"/><ATTR name="localUserName" value="dteam001"/><ATTR name="localGroupName" value="dteam"/><ATTR name="lcgJobId" value="https://lxn1177.cern.ch:9000/Np32JsWVPiHZLuiLIeSz2w"/><ATTR name="bqsJobId" value="lcg1128183347-18377"/><ATTR name="gassStdOutput" value="/home/dteam001/.globus/.gass_cache/local/md5/aa/b7a09a5666c76c007d134e19a9c058/md5/16/4ceb1467e9e3c9c3b65be40fd13e48/data"/><ATTR name="gassStdError" value="/home/dteam001/.globus/.gass_cache/local/md5/aa/b7a09a5666c76c007d134e19a9c058/md5/a4/8b0c777c6cf9303ecd791ec316042f/data"/><ATTR name="SubmissionDate" value="2005/11/28-18h33:47 "/><ATTR name="jobmonitorEntry" value="/opt/globus/tmp/gram_job_state/job.cclcgceli05.in2p3.fr.18347.1133199221"/><ATTR name="lastQuery" value="1133199240"/><ATTR name="jobStatus" value="QUEUED"/><ATTR name="gramState" value="1"/><ATTR name="UserEmail" value="jonathan.schaeffer@in2p3.fr"/></JOB> The code which reproduces the bug : use XML::XSLT; my $xml_filename = "job.props"; my $xsl_filename = "bqsJobwrapper.xsl"; my $output_filename = "job.sh"; my $xslt = XML::XSLT->new($xsl_filename); $xslt->transform ($xml_filename); print $xslt->toString;
Show quoted text
> <xsl:if test="ATTR[@name='UserEmail']/@value" >
The patch submitted for http://rt.cpan.org/Ticket/Display.html?id=18482 may partially correct this problem. It adds support for the ATTR[@name='UserEmail'] portion (but not the /@value portion).
On Tue Dec 06 03:59:18 2005, guest wrote: Show quoted text
> I came accross an error in transalation behaviour. The value of each > <xsl:value-of /> markup is the same when using this module but the > output is what I would expect using xsltproc. Here are the concerned > files. > > Using this style-sheet : > > <xsl:stylesheet > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > <xsl:template match="/JOB"> > #!/bin/sh > <!-- UserEmail est a Ajouter dans le code de bqs.pm --> > <xsl:if test="ATTR[@name='UserEmail']/@value" > > #PBS -mu <xsl:value-of select="ATTR[@name='UserEmail']/@value"/> > </xsl:if> > <xsl:if test="JOB/ATTR[@name='bqsQueueName']/@value" > > #PBS -q <xsl:value-of select="ATTR[@name='bqsQueueName']/@value"/> > </xsl:if> > <xsl:if test="ATTR[@name='bqsQueueMaxAllowedMemory']/@value" > > #PBS -l M=<xsl:value-of > select="ATTR[@name='bqsQueueMaxAllowedMemory']/@value"/> > </xsl:if> > <xsl:if test="ATTR[@name='bqsQueueMaxCPUTime']/@value" > > #PBS -l T=<xsl:value-of > select="ATTR[@name='bqsQueueMaxCPUTime']/@value"/> > </xsl:if> > <xsl:if test="ATTR[@name='bqsQueueMaxAllowedScratch']/@value" > > #PBS -l scratch=<xsl:value-of > select="ATTR[@name='bqsQueueMaxAllowedScratch']/@value"/> > </xsl:if> > <xsl:if test="ATTR[@name='bqsQueueMaxCPUTime']/@value" > > #PBS -l platform=<xsl:value-of > select="ATTR[@name='bqsQueueMaxCPUTime']/@value"/> > </xsl:if> > <!-- Cette ligne doit etre calculee en fonction de la conf de la VO > en question : select="ATTR[@name > ='localGroupName']/@value --> > #PBS -l LCG= > <xsl:if test="ATTR[@name='gridUserId']/@value"> > # > # Grid User Id : '<xsl:value-of > select="ATTR[@name='gridUserId']/@value"/> > # > </xsl:if> > > </xsl:template> > <xsl:template match="ATTR[@name='bqsQueueName']" > > #PBS -PLOP <xsl:value-of select="@value"/> > </xsl:template> > </xsl:stylesheet> > > > ------------------- > > And this is my XML file to parse : > <JOB><ATTR name="bqsCluster" value="lcg"/><ATTR name="bqsQueueName" > value="A"/><ATTR name="bqsQueueMaxAllowedMemory" value="512"/><ATTR > name="bqsQueueMaxCPUTime" value="500"/><ATTR > name="bqsQueueMaxAllowedScratch" value="1025"/><ATTR name="gridUserId" > value="/O=GRID-FR/C=FR/O=CNRS/OU=CC-LYON/CN=Jonathan > Schaeffer/Email=jonathan.schaeffer@cc.in2p3.fr"/><ATTR > name="localUserName" value="dteam001"/><ATTR name="localGroupName" > value="dteam"/><ATTR name="lcgJobId" > value="https://lxn1177.cern.ch:9000/Np32JsWVPiHZLuiLIeSz2w"/><ATTR > name="bqsJobId" value="lcg1128183347-18377"/><ATTR > name="gassStdOutput" > value="/home/dteam001/.globus/.gass_cache/local/md5/aa/b7a09a5666c76c007d134e19a9c058/md5/16/4ceb1467e9e3c9c3b65be40fd13e48/data"/><ATTR > name="gassStdError" > value="/home/dteam001/.globus/.gass_cache/local/md5/aa/b7a09a5666c76c007d134e19a9c058/md5/a4/8b0c777c6cf9303ecd791ec316042f/data"/><ATTR > name="SubmissionDate" value="2005/11/28-18h33:47 "/><ATTR > name="jobmonitorEntry" > value="/opt/globus/tmp/gram_job_state/job.cclcgceli05.in2p3.fr.18347.1133199221"/><ATTR > name="lastQuery" value="1133199240"/><ATTR name="jobStatus" > value="QUEUED"/><ATTR name="gramState" value="1"/><ATTR > name="UserEmail" value="jonathan.schaeffer@in2p3.fr"/></JOB> > > The code which reproduces the bug : > > use XML::XSLT; > > my $xml_filename = "job.props"; > my $xsl_filename = "bqsJobwrapper.xsl"; > my $output_filename = "job.sh"; > > my $xslt = XML::XSLT->new($xsl_filename); > > $xslt->transform ($xml_filename); > print $xslt->toString;
I think this may be fixed by https://github.com/jonathanstowe/XML-XSLT/commit/2127a5e2cb93c1e0b4dffb1a7ef7a00ed89c2fd9 if it isn't please open a new ticket with a test case that reflects the new behaviour. Thanks.