self::node vs. . (dot)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

self::node vs. . (dot)

dr.cw.ray
I used the following code to make an xf:group relevant. Notice the .
(dot) in the ref.
It worked fine in my first model where the data was in a single model
with two instances, the first instance was not named, and the second
one was id='inst2'.

<xf:group ref=".[instance('inst2')/showCase0 = 0]">

<h:div style="margin-left:10ex;">
<xf:trigger appearance='minimal'>
<xf:label class='navtab'>
First Section
</xf:label>
<xf:toggle case="ccase1" ev:event="DOMActivate"/>
</xf:trigger>
</h:div>

</xf:group>

Later, however, I changed my data structure so that all nodes are in
a single model and single instance. So I went with the following
which did not work with the . (dot) but did work with self::node.
Both codes are below.
Is this a bug, or a misunderstanding on my part.

Not working:

<xf:group ref=".[//studentid = //studentidVerify]">

<h:div style="margin-left:10ex;">
<xf:trigger appearance='minimal'>
<xf:label class='navtab'>
First Section
</xf:label>
<xf:toggle case="ccase1" ev:event="DOMActivate"/>
</xf:trigger>
</h:div>

</xf:group>

Works fine:

<xf:group ref="self::node()[//studentid = //studentidVerify]">

<h:div style="margin-left:10ex;">
<xf:trigger appearance='minimal'>
<xf:label class='navtab'>
First Section
</xf:label>
<xf:toggle case="ccase1" ev:event="DOMActivate"/>
</xf:trigger>
</h:div>

</xf:group>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: self::node vs. . (dot)

Aaron Reed
I don't know why there would be a difference.  I would suggest trying
your form on a couple of other processors.  If they work and we didn't,
open a bug on us with the testcase included.  If the other processors
work the same as ours, I would suggest asking the W3C working group.
They have some guys that understand xpath subtleties better than I do.

--Aaron

[hidden email] wrote:

> I used the following code to make an xf:group relevant. Notice the .
> (dot) in the ref.
> It worked fine in my first model where the data was in a single model
> with two instances, the first instance was not named, and the second
> one was id='inst2'.
>
> <xf:group ref=".[instance('inst2')/showCase0 = 0]">
>
> <h:div style="margin-left:10ex;">
> <xf:trigger appearance='minimal'>
> <xf:label class='navtab'>
> First Section
> </xf:label>
> <xf:toggle case="ccase1" ev:event="DOMActivate"/>
> </xf:trigger>
> </h:div>
>
> </xf:group>
>
> Later, however, I changed my data structure so that all nodes are in
> a single model and single instance. So I went with the following
> which did not work with the . (dot) but did work with self::node.
> Both codes are below.
> Is this a bug, or a misunderstanding on my part.
>
> Not working:
>
> <xf:group ref=".[//studentid = //studentidVerify]">
>
> <h:div style="margin-left:10ex;">
> <xf:trigger appearance='minimal'>
> <xf:label class='navtab'>
> First Section
> </xf:label>
> <xf:toggle case="ccase1" ev:event="DOMActivate"/>
> </xf:trigger>
> </h:div>
>
> </xf:group>
>
> Works fine:
>
> <xf:group ref="self::node()[//studentid = //studentidVerify]">
>
> <h:div style="margin-left:10ex;">
> <xf:trigger appearance='minimal'>
> <xf:label class='navtab'>
> First Section
> </xf:label>
> <xf:toggle case="ccase1" ev:event="DOMActivate"/>
> </xf:trigger>
> </h:div>
>
> </xf:group>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: self::node vs. . (dot)

Klotz, Leigh
Additionally, note that there's an oversight or omission in the XPath
1.0 Rec that doesn't allow .[] but allows self::node()[].
As Nick van den Bleeken pointed out in today's Forms Working Group
teleconference, XPath 2.0 remedies this problem and allows it.
Some XPath 1.0 implementators read the spec carefully and disallowed it;
others didn't.
I think it depends on your spec-following religion whether you think
that it ought to be avoided (or not implemented) until XPath 2.0.

Personally I think it's a silly bug and XPath 1.0 implementations ought
to simply do the right thing.  But I'm not an XPath expert, and there
may be some subtle semantic difference in XPath 1.0 that somehow is
magically resolved in XPath 2.0 that makes it possible there.

Leigh.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Aaron
Reed
Sent: Wednesday, January 30, 2008 10:40 AM
To: [hidden email]
Subject: Re: self::node vs. . (dot)

I don't know why there would be a difference.  I would suggest trying
your form on a couple of other processors.  If they work and we didn't,
open a bug on us with the testcase included.  If the other processors
work the same as ours, I would suggest asking the W3C working group.
They have some guys that understand xpath subtleties better than I do.

--Aaron

[hidden email] wrote:

> I used the following code to make an xf:group relevant. Notice the .
> (dot) in the ref.
> It worked fine in my first model where the data was in a single model
> with two instances, the first instance was not named, and the second
> one was id='inst2'.
>
> <xf:group ref=".[instance('inst2')/showCase0 = 0]">
>
> <h:div style="margin-left:10ex;">
> <xf:trigger appearance='minimal'>
> <xf:label class='navtab'>
> First Section
> </xf:label>
> <xf:toggle case="ccase1" ev:event="DOMActivate"/>
> </xf:trigger>
> </h:div>
>
> </xf:group>
>
> Later, however, I changed my data structure so that all nodes are in
> a single model and single instance. So I went with the following
> which did not work with the . (dot) but did work with self::node.
> Both codes are below.
> Is this a bug, or a misunderstanding on my part.
>
> Not working:
>
> <xf:group ref=".[//studentid = //studentidVerify]">
>
> <h:div style="margin-left:10ex;">
> <xf:trigger appearance='minimal'>
> <xf:label class='navtab'>
> First Section
> </xf:label>
> <xf:toggle case="ccase1" ev:event="DOMActivate"/>
> </xf:trigger>
> </h:div>
>
> </xf:group>
>
> Works fine:
>
> <xf:group ref="self::node()[//studentid = //studentidVerify]">
>
> <h:div style="margin-left:10ex;">
> <xf:trigger appearance='minimal'>
> <xf:label class='navtab'>
> First Section
> </xf:label>
> <xf:toggle case="ccase1" ev:event="DOMActivate"/>
> </xf:trigger>
> </h:div>
>
> </xf:group>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms