Closed
Bug 312848
Opened 19 years ago
Closed 19 years ago
XPath expressions using namespaces inside repeats generate error messages
Categories
(Core Graveyard :: XForms, defect)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mozilla.org, Assigned: aaronr)
References
Details
(Keywords: fixed1.8.0.2, fixed1.8.1)
Attachments
(2 files, 1 obsolete file)
(deleted),
application/xhtml+xml
|
Details | |
(deleted),
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
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
error in the JavaScript Console for each top node in the repeat nodeset. This
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
binds.
Reproducible: Always
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
Actual Results:
Results are shown, but "size(repeat nodeset) * count(elements with @ref or @bind
in the repeat)" errors show up for the repeat.
Expected Results:
Results are shown without any errors.
Typical error message: "Error: XForms Error (10): Error parsing XPath
expression: jobs:Description".
Moving the "offending" elements outside the repeat still results in output (if
the reference is absolute), but no errors.
Reporter | ||
Comment 1•19 years ago
|
||
Here's the relevant part of my XForms (chopped off unnecessary parts):
<xf:repeat id="job-repeat"
nodeset="instance('jobsFile')/jobs:Jobs/jobs:Job[position()!=last()]">
<xf:input bind="job-parentslotid-bind">
<xf:label>Slot</xf:label>
</xf:input>
<xf:select1 ref="jobs:Description">
<xf:label>Job</xf:label>
<xf:item>
<xf:label>INterconnection check before starting</xf:label>
<xf:value>INterconnection check before starting</xf:value>
</xf:item>
<xf:item>
<xf:label>IWP01.020 Main superconduct. cables soldering</xf:label>
<xf:value>IWP01.020 Main superconduct. cables soldering</xf:value>
</xf:item>
<xf:alert>The job does not exist!</xf:alert>
</xf:select1>
<xf:output ref="jobs:ExecutedBy">
<xf:label>Executed by</xf:label>
</xf:output>
</xf:repeat>
Comment 2•19 years ago
|
||
I see the same, and yes only for controls inside a repeat using namespaces in
their expressions, like ref="be:x".
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: @ref and @bind in repeats generate unnecessary error messages → XPath expressions using namespaces inside repeats generate error messages
Updated•19 years ago
|
OS: Windows XP → All
Hardware: PC → All
Comment 3•19 years ago
|
||
Comment 4•19 years ago
|
||
The failure starts here:
http://lxr.mozilla.org/seamonkey/source/extensions/transformiix/source/xpath/ExprParser.cpp#688
Comment 5•19 years ago
|
||
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.
Attachment #202246 -
Flags: review?(aaronr)
Updated•19 years ago
|
Status: NEW → ASSIGNED
Comment on attachment 202246 [details] [diff] [review]
Patch
>+ // 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.
Attachment #202246 -
Flags: review?(aaronr) → review+
Comment 7•19 years ago
|
||
Attachment #202246 -
Attachment is obsolete: true
Attachment #202964 -
Flags: review?(smaug)
Updated•19 years ago
|
Attachment #202964 -
Flags: review?(smaug) → review+
Reporter | ||
Comment 9•19 years ago
|
||
Thanks a lot! Keep up the great work!
Too bad I have to wait for the next nightly build to test it ;-)
Comment 10•19 years ago
|
||
(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:
http://developer.mozilla.org/en/docs/Build_Documentation
;-)
Assignee | ||
Comment 11•19 years ago
|
||
checked into MOZILLA_1_8_BRANCH via bug 323691. Leaving open for now until it gets into 1.8.0
Updated•19 years ago
|
Whiteboard: xf-to-branch
Updated•19 years ago
|
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•