Yet another testcase question

Jon Kerny <[email protected]> Tue, 10 May 2016 21:49:29 +0200
Newsgroups gmane.comp.web.voice
Message-ID <CAC5YMgGePCgcY20too73AW98001pquMKJeJKQNBLKnXdFgUFoA@mail.gmail.com>
--001a11493a2c2bbf9a0532823942
Content-Type: text/plain; charset=UTF-8

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:

https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-A6C9094
https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177
https://www.w3.org/2003/01/dom2-javadoc/org/w3c/dom/NodeList.html
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection

That said, I think it's common in implementations. I.e. w3schools includes
it in the examples
http://www.w3schools.com/jsref/met_element_getelementsbytagname.asp

Best regards,

Jon

--001a11493a2c2bbf9a0532823942
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>I have now almost completed the sup=
port of both ecmascript and xpath data models, and I have two more question=
s/comments.</div><div><br></div><div>In the xpath xsl I think there is miss=
ing single quotes in the template</div><div><br></div><div><div class=3D"" =
style=3D"color:rgb(0,0,0);font-family:monospace;font-size:13px"><span class=
=3D"">&lt;xsl:template<span class=3D"">=C2=A0<span class=3D"">match</span>=
=3D&quot;<span class=3D"">//@conf:messageBodyEquals</span>&quot;</span>&gt;=
</span></div><div class=3D"" style=3D"margin-left:1em;color:rgb(0,0,0);font=
-family:monospace;font-size:13px"><span class=3D""></span><div class=3D"" i=
d=3D"collapsible155"><div class=3D""><div class=3D""><span class=3D"" style=
=3D"display:inline-block;width:10px;vertical-align:bottom;height:10px;backg=
round:url(&quot;&quot;)"></span><span class=3D"">&lt;xsl:attribute<span cla=
ss=3D"">=C2=A0<span class=3D"">name</span>=3D&quot;<span class=3D"">cond</s=
pan>&quot;</span>&gt;</span></div><div class=3D"" style=3D"margin-left:1em"=
><span class=3D"">contains($_event/raw,</span><div class=3D""><span class=
=3D"">&lt;xsl:value-of<span class=3D"">=C2=A0<span class=3D"">select</span>=
=3D&quot;<span class=3D"">.</span>&quot;</span>/&gt;</span></div><span clas=
s=3D"">)</span></div><div class=3D""><span class=3D"">&lt;/xsl:attribute&gt=
;</span></div></div></div><span class=3D""></span></div><div class=3D"" sty=
le=3D"color:rgb(0,0,0);font-family:monospace;font-size:13px"><span class=3D=
"">&lt;/xsl:template&gt;</span></div></div><div class=3D"" style=3D"color:r=
gb(0,0,0);font-family:monospace;font-size:13px"><span class=3D""><br></span=
></div><div class=3D"" style=3D"color:rgb(0,0,0);font-family:monospace;font=
-size:13px"><span class=3D"">I think it should be=C2=A0</span></div><div cl=
ass=3D"" style=3D"color:rgb(0,0,0);font-family:monospace;font-size:13px"><s=
pan class=3D""><br></span></div><div class=3D"" style=3D"color:rgb(0,0,0);f=
ont-family:monospace;font-size:13px"><span class=3D""><div class=3D""><span=
 class=3D"">&lt;xsl:template<span class=3D"">=C2=A0<span class=3D"">match</=
span>=3D&quot;<span class=3D"">//@conf:messageBodyEquals</span>&quot;</span=
>&gt;</span></div><div class=3D"" style=3D"margin-left:1em"><span class=3D"=
"></span><div class=3D"" id=3D"collapsible155"><div class=3D""><div class=
=3D""><span class=3D"" style=3D"display:inline-block;width:10px;vertical-al=
ign:bottom;height:10px;background:url(&quot;&quot;)"></span><span class=3D"=
">&lt;xsl:attribute<span class=3D"">=C2=A0<span class=3D"">name</span>=3D&q=
uot;<span class=3D"">cond</span>&quot;</span>&gt;</span></div><div class=3D=
"" style=3D"margin-left:1em"><span class=3D"">contains($_event/raw,</span><=
div class=3D""><span class=3D"">&#39;&lt;xsl:value-of<span class=3D"">=C2=
=A0<span class=3D"">select</span>=3D&quot;<span class=3D"">.</span>&quot;</=
span>/&gt;&#39;</span></div><span class=3D"">)</span></div><div class=3D"">=
<span class=3D"">&lt;/xsl:attribute&gt;</span></div></div></div><span class=
=3D""></span></div><div class=3D""><span class=3D"">&lt;/xsl:template&gt;</=
span></div></span></div><div><br></div><div><br></div><div>And I also have =
a question on the ecmascript testcases 557 and 561, they contain the condit=
ion</div><div>cond=3D&quot;var1.getElementsByTagName(&#39;book&#39;)[0].get=
Attribute(&#39;title&#39;) =3D=3D &#39;title1&#39;&quot;<br></div><div><br>=
</div><div>I wonder if this isn&#39;t strictly following the specifications=
. Shouldn&#39;t it be</div><div><br></div><div>cond=3D&quot;var1.getElement=
sByTagName(&#39;book&#39;).item(0).getAttribute(&#39;title&#39;) =3D=3D &#3=
9;title1&#39;&quot;<br></div><div><br></div><div><br></div><div>I don&#39;t=
 think the indexer is part of the specification:</div><div><br></div><div><=
a href=3D"https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-A6C9094">http=
s://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-A6C9094</a><br></div><div><=
a href=3D"https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177">ht=
tps://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177</a><br></div><d=
iv><a href=3D"https://www.w3.org/2003/01/dom2-javadoc/org/w3c/dom/NodeList.=
html">https://www.w3.org/2003/01/dom2-javadoc/org/w3c/dom/NodeList.html</a>=
<br></div><div><a href=3D"https://developer.mozilla.org/en-US/docs/Web/API/=
HTMLCollection">https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollec=
tion</a><br></div><div><br></div><div>That said, I think it&#39;s common in=
 implementations. I.e. w3schools includes it in the examples</div><div><a h=
ref=3D"http://www.w3schools.com/jsref/met_element_getelementsbytagname.asp"=
>http://www.w3schools.com/jsref/met_element_getelementsbytagname.asp</a><br=
></div><div><br></div><div>Best regards,</div><div><br></div><div>Jon</div>=
<div><br></div></div>

--001a11493a2c2bbf9a0532823942--