User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051017 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051017 Firefox/1.6a1
Each "output", "input", and "select1" element inside a repeat will generate an
happens even if the data of these elements are shown according to the @bind /
@ref in the output.
The result is the same when using relative references, absolute references, or
Steps to Reproduce:
1. Add a repeat to your XForms, with @nodeset
2. Add an "output", "input", or "select1" element inside the repeat
3. Bind these to instance data using @ref or @bind
Results are shown, but "size(repeat nodeset) * count(elements with @ref or @bind
in the repeat)" errors show up for the repeat.
Results are shown without any errors.
Typical error message: "Error: XForms Error (10): Error parsing XPath
Moving the "offending" elements outside the repeat still results in output (if
the reference is absolute), but no errors.
Here's the relevant part of my XForms (chopped off unnecessary parts):
<xf:label>INterconnection check before starting</xf:label>
<xf:value>INterconnection check before starting</xf:value>
<xf:label>IWP01.020 Main superconduct. cables soldering</xf:label>
<xf:value>IWP01.020 Main superconduct. cables soldering</xf:value>
<xf:alert>The job does not exist!</xf:alert>
I see the same, and yes only for controls inside a repeat using namespaces in
their expressions, like ref="be:x".
Created attachment 200181 [details]
The failure starts here:
Created attachment 202246 [details] [diff] [review]
Problem was, that we (I) were cloning children into the contextcontainer, before inserting the cc into the repeat... I vaguely remember having done that for a reason, but that's lost on me.
This patch inserts the cc into the repeat before inserting children. That makes the namespace lookup succeed. It also removes some dead code from nsXFormsUtils.
Comment on attachment 202246 [details] [diff] [review]
>+ // Insert context node
>+ nsCOMPtr<nsIDOMNode> domNode;
>+ rv = mHTMLElement->AppendChild(riElement, getter_AddRefs(domNode));
>+ NS_ENSURE_SUCCESS(rv, rv);
nit: please comment why you are adding this node before populating it with children since it seems contrary to what we do in other places. And in case someone thinks about moving it back in the future for some other reason, they'll at least know a problem that it could cause.
Created attachment 202964 [details] [diff] [review]
Checked into trunk
Thanks a lot! Keep up the great work!
Too bad I have to wait for the next nightly build to test it ;-)
(In reply to comment #9)
> Thanks a lot! Keep up the great work!
> Too bad I have to wait for the next nightly build to test it ;-)
Well, that's all up to you:
checked into MOZILLA_1_8_BRANCH via bug 323691. Leaving open for now until it gets into 1.8.0
verfied fixed on MOZILLA_1_8_BRANCH