Yet another testcase question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Yet another testcase question

Jon Kerny
Hi,

I have now almost completed the support of both ecmascript and xpath data models, and I have two more questions/comments.

In the xpath xsl I think there is missing single quotes in the template

<xsl:template match="//@conf:messageBodyEquals">
<xsl:attribute name="cond">
contains($_event/raw,
<xsl:value-of select="."/>
)
</xsl:attribute>
</xsl:template>

I think it should be 

<xsl:template match="//@conf:messageBodyEquals">
<xsl:attribute name="cond">
contains($_event/raw,
'<xsl:value-of select="."/>'
)
</xsl:attribute>
</xsl:template>


And I also have a question on the ecmascript testcases 557 and 561, they contain the condition
cond="var1.getElementsByTagName('book')[0].getAttribute('title') == 'title1'"

I wonder if this isn't strictly following the specifications. Shouldn't it be

cond="var1.getElementsByTagName('book').item(0).getAttribute('title') == 'title1'"


I don't think the indexer is part of the specification:


That said, I think it's common in implementations. I.e. w3schools includes it in the examples

Best regards,

Jon

Reply | Threaded
Open this post in threaded view
|

Re: Yet another testcase question

Jim Barnett

Jon,

  The XPath xslt document was never fully tested out, so you are likely right about it. 

 For the ecmascript tests, the question is a bit more complicated.  In general,  developers are allowed to edit the xslt files to match their environment, as long as they do not change the 'intent' of the test.  This is done on the honor system, and we don't check to determine exactly what they did.  As things stand, 3 systems reported passing tests 557 and 561.  In general people report if they edit the xslt files, so it's likely that their ecma implementations accepted the looser syntax, but I don't know for sure. 

By the way, thank you for your comments on the tests.  It's worthwhile having these issues recorded on the mailing list, so that other implementers can see the remarks.  However, since work on SCXML has been completed and the Voice Browser Working Group has been closed,  we won't be fixing the tests. 


- Jim


On 5/10/2016 3:49 PM, Jon Kerny wrote:
Hi,

I have now almost completed the support of both ecmascript and xpath data models, and I have two more questions/comments.

In the xpath xsl I think there is missing single quotes in the template

<xsl:template match="//@<a class="moz-txt-link-freetext" href="conf:messageBodyEquals">conf:messageBodyEquals">
<xsl:attribute name="cond">
contains($_event/raw,
<xsl:value-of select="."/>
)
</xsl:attribute>
</xsl:template>

I think it should be 

<xsl:template match="//@<a class="moz-txt-link-freetext" href="conf:messageBodyEquals">conf:messageBodyEquals">
<xsl:attribute name="cond">
contains($_event/raw,
'<xsl:value-of select="."/>'
)
</xsl:attribute>
</xsl:template>


And I also have a question on the ecmascript testcases 557 and 561, they contain the condition
cond="var1.getElementsByTagName('book')[0].getAttribute('title') == 'title1'"

I wonder if this isn't strictly following the specifications. Shouldn't it be

cond="var1.getElementsByTagName('book').item(0).getAttribute('title') == 'title1'"


I don't think the indexer is part of the specification:


That said, I think it's common in implementations. I.e. w3schools includes it in the examples

Best regards,

Jon