<none>

Jon Kerny <[email protected]> Sun, 1 May 2016 23:02:14 +0200
Newsgroups gmane.comp.web.voice
Message-ID <CAC5YMgHJ_N1gjMk8_nVrQ0gtwUOUsM+5zhBir2P12BffusKj5A@mail.gmail.com>
--001a1143e690c66e000531ce30e1
Content-Type: text/plain; charset=UTF-8

Hi,

I've been looking at test354.txml
<https://www.w3.org/Voice/2013/scxml-irp/354/test354.txml> in the scxml
irp. For xpath it makes use of a template implemented like this:

<xsl:template match="//@conf:eventDataNamelistValue">
<xsl:attribute name="expr">
$_event/data/data[@id='Var
<xsl:value-of select="."/>
']/data/text()
</xsl:attribute>
</xsl:template>

It creates an expression like this:

expr="$_event/data/data[@id='Var1']/data/text()"

I don't understand why there should be three levels of data?

The first is from event, ok.
The second is from 2.7.1 in the xpath specification, ok

But why is there a third data element?

Why isn't a template below used?

<xsl:template match="//@conf:eventDataNamelistValue">
<xsl:attribute name="expr">
$_event/data/data[@id='Var
<xsl:value-of select="."/>
']/text()
</xsl:attribute>
</xsl:template>

Where in the specifications does it say that there should be a
event/data/data[@id='']/data/ structure when using xpath?

For ecmascript the template looks like:

<xsl:template match="//@conf:eventDataNamelistValue">
<xsl:attribute name="expr">
_event.data.Var
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>

I cannot understand why there is a difference.

Best regards,

Jon

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

<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>I&#39;ve been looking at=
 <a href=3D"https://www.w3.org/Voice/2013/scxml-irp/354/test354.txml" style=
=3D"color:rgb(85,34,153);font-family:sans-serif;font-size:medium;background=
:transparent">test354.txml</a>=C2=A0in the scxml irp. For xpath it makes us=
e of a template implemented like this:</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:eventDataNamelistValue</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 cl=
ass=3D"" id=3D"collapsible123"><div class=3D""><div class=3D""><span class=
=3D"" style=3D"display:inline-block;width:10px;vertical-align:bottom;height=
:10px;background:url(&quot;&quot;)"></span><span class=3D"">&lt;xsl:attribu=
te<span class=3D"">=C2=A0<span class=3D"">name</span>=3D&quot;<span class=
=3D"">expr</span>&quot;</span>&gt;</span></div><div class=3D"" style=3D"mar=
gin-left:1em"><span class=3D"">$_event/data/data[@id=3D&#39;Var</span><div =
class=3D""><span class=3D"">&lt;xsl:value-of<span class=3D"">=C2=A0<span cl=
ass=3D"">select</span>=3D&quot;<span class=3D"">.</span>&quot;</span>/&gt;<=
/span></div><span class=3D"">&#39;]/data/text()</span></div><div class=3D""=
><span class=3D"">&lt;/xsl:attribute&gt;</span></div></div></div><span clas=
s=3D""></span></div><div class=3D"" style=3D"color:rgb(0,0,0);font-family:m=
onospace;font-size:13px"><span class=3D"">&lt;/xsl:template&gt;</span></div=
></div><div class=3D"" style=3D"color:rgb(0,0,0);font-family:monospace;font=
-size:13px"><span class=3D""><br></span></div><div class=3D"" style=3D"colo=
r:rgb(0,0,0);font-family:monospace;font-size:13px"><span class=3D"">It crea=
tes an expression like this:</span></div><div class=3D"" style=3D"color:rgb=
(0,0,0);font-family:monospace;font-size:13px"><span class=3D""><br></span><=
/div><div class=3D"" style=3D""><span class=3D""><font color=3D"#000000" fa=
ce=3D"monospace">expr=3D&quot;$_event/data/data[@id=3D&#39;Var1&#39;]/data/=
text()&quot;=C2=A0</font><br></span></div><div class=3D"" style=3D""><span =
class=3D""><font color=3D"#000000" face=3D"monospace"><br></font></span></d=
iv><div class=3D"" style=3D""><span class=3D""><font color=3D"#000000" face=
=3D"monospace">I don&#39;t understand why there should be three levels of d=
ata?</font></span></div><div class=3D"" style=3D""><span class=3D""><font c=
olor=3D"#000000" face=3D"monospace"><br></font></span></div><div class=3D""=
 style=3D""><span class=3D""><font color=3D"#000000" face=3D"monospace">The=
 first is from event, ok.</font></span></div><div class=3D"" style=3D""><sp=
an class=3D""><font color=3D"#000000" face=3D"monospace">The second is from=
 2.7.1 in the xpath specification, ok</font></span></div><div class=3D"" st=
yle=3D""><span class=3D""><font color=3D"#000000" face=3D"monospace"><br></=
font></span></div><div class=3D"" style=3D""><span class=3D""><font color=
=3D"#000000" face=3D"monospace">But why is there a third data element?</fon=
t></span></div><div class=3D"" style=3D""><span class=3D""><font color=3D"#=
000000" face=3D"monospace"><br></font></span></div><div class=3D"" style=3D=
""><span class=3D""><font color=3D"#000000" face=3D"monospace">Why isn&#39;=
t a template below used?</font></span></div><div class=3D"" style=3D""><spa=
n class=3D""><font color=3D"#000000" face=3D"monospace"><br></font></span><=
/div><div class=3D"" style=3D""><span class=3D""><div class=3D"" style=3D"c=
olor:rgb(0,0,0);font-family:monospace;font-size:13px"><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:eventDataNamelistValue</span>&quot;<=
/span>&gt;</span></div><div class=3D"" style=3D"margin-left:1em"><span clas=
s=3D""></span><div class=3D"" id=3D"collapsible123"><div class=3D""><div cl=
ass=3D""><span class=3D"" style=3D"display:inline-block;width:10px;vertical=
-align: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&quot;<span class=3D"">expr</span>&quot;</span>&gt;</span></div><div cla=
ss=3D"" style=3D"margin-left:1em"><span class=3D"">$_event/data/data[@id=3D=
&#39;Var</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 class=3D"">&#39;]/text()</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;/xs=
l:template&gt;</span></div></div><div class=3D"" style=3D"color:rgb(0,0,0);=
font-family:monospace;font-size:13px"><span class=3D""><br></span></div><di=
v class=3D"" style=3D"color:rgb(0,0,0);font-family:monospace;font-size:13px=
"><span class=3D"">Where in the specifications does it say that there shoul=
d be a event/data/data[@id=3D&#39;&#39;]/data/ structure when using xpath?<=
/span></div><div class=3D"" style=3D"color:rgb(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"">Fo=
r ecmascript the template looks like:</span></div><div class=3D"" style=3D"=
color:rgb(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:monospa=
ce;font-size:13px"><span class=3D""><div class=3D""><span class=3D"">&lt;xs=
l:template<span class=3D"">=C2=A0<span class=3D"">match</span>=3D&quot;<spa=
n class=3D"">//@conf:eventDataNamelistValue</span>&quot;</span>&gt;</span><=
/div><div class=3D"" style=3D"margin-left:1em"><span class=3D""></span><div=
 class=3D"" id=3D"collapsible80"><div class=3D""><div class=3D""><span clas=
s=3D"" style=3D"display:inline-block;width:10px;vertical-align:bottom;heigh=
t:10px;background:url(&quot;&quot;)"></span><span class=3D"">&lt;xsl:attrib=
ute<span class=3D"">=C2=A0<span class=3D"">name</span>=3D&quot;<span class=
=3D"">expr</span>&quot;</span>&gt;</span></div><div class=3D"" style=3D"mar=
gin-left:1em"><span class=3D"">_event.data.Var</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></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;/x=
sl:template&gt;</span></div><div class=3D""><br></div><div class=3D"">I can=
not understand why there is a difference.</div></span></div><div class=3D""=
 style=3D"color:rgb(0,0,0);font-family:monospace;font-size:13px"><span clas=
s=3D""><br></span></div><div class=3D"" style=3D"color:rgb(0,0,0);font-fami=
ly:monospace;font-size:13px"><span class=3D"">Best regards,</span></div><di=
v class=3D"" style=3D"color:rgb(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"">Jon</span></div><=
div class=3D"" style=3D"color:rgb(0,0,0);font-family:monospace;font-size:13=
px"><br></div></span></div><div class=3D"" style=3D""><span class=3D""><fon=
t color=3D"#000000" face=3D"monospace"><br></font></span></div></div>

--001a1143e690c66e000531ce30e1--