Closed Bug 282263 Opened 21 years ago Closed 21 years ago

XForms Submission doesn't copy over namespaces.

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: doronr, Assigned: aaronr)

Details

Attachments

(1 file)

To take care of the default namespace processing in xforms:submission as mentioned in http://www.w3.org/TR/xforms/index-all.html#structure-model-submission under the @includenamespaceprefixes description.
This is somehow related to Bug 268285.
Indeed, 268285 is related. Have a patch.
Status: NEW → ASSIGNED
Attached patch patchSplinter Review
Comment on attachment 174617 [details] [diff] [review] patch Allan - I moved your code to get the xforms:instance from an instance data node, so asking for review as it touches your code :) Aaron, want to give 2nd r?
Attachment #174617 - Flags: review?(allan)
nit: I'd suggest that you return nsnull in aInstanceNode in the function nsXFormsUtils::GetInstanceNodeForData() if it is going to return an error. Just to help out the yahoos that don't check return codes. Also you should check out what the proper submission behavior should be if you have the same namespace on the xf:instance node as you do on the document. You could even have the same namespace url on each but with different prefixes, can't you? I don't think that it is as easy as just copying the document's xmlns attrs and then the instance element's xmlns attrs. I can check with the W3C guys for a clarification, if you want. Otherwise I thought that it looked ok.
(In reply to comment #6) > Also you should check out what the proper submission behavior should be if you > have the same namespace on the xf:instance node as you do on the document. You > could even have the same namespace url on each but with different prefixes, > can't you? I don't think that it is as easy as just copying the document's > xmlns attrs and then the instance element's xmlns attrs. I can check with the > W3C guys for a clarification, if you want. > the xf:instance node wins, which is what the code does. Nodes are allowed to overrule any existing xmlns' I believe, and I think the patch does the right thing given the fact that mozilla doesn't implement namespace nodes. Its perfectly valid to have the same URL referenced by several xmlns:* :)
Assignee: doronr → aaronr
Status: ASSIGNED → NEW
Comment on attachment 174617 [details] [diff] [review] patch >+++ extensions/xforms/nsXFormsUtils.cpp 17 Feb 2005 22:41:28 -0000 >+/* static */ nsresult >+nsXFormsUtils::GetInstanceNodeForData(nsIDOMNode *aInstanceDataNode, >+ nsIModelElementPrivate *aModel, >+ nsIDOMNode **aInstanceNode) Indent arguments. >+{ >+ /* We want to get at the <xf:instance> that aInstanceDataNode belongs to. >+ We get all xf:instance nodes in the aModel, QI it to nsIInstanceElementPrivate >+ and compare its document to the document aInstanceDataNode lives in. >+ */ >+ >+ nsCOMPtr<nsIDOMDocument> instanceDoc; null-check. >+ aInstanceDataNode->GetOwnerDocument(getter_AddRefs(instanceDoc)); >+ // owner doc is null when the data node is the document (e.g., ref="/") >+ if (!instanceDoc) >+ instanceDoc = do_QueryInterface(aInstanceDataNode); >+ NS_ENSURE_TRUE(instanceDoc, NS_ERROR_UNEXPECTED); >+ >+ nsCOMPtr<nsIDOMElement> modelElem = do_QueryInterface(aModel); >+ NS_ENSURE_STATE(modelElem); >+ nsCOMPtr<nsIDOMNodeList> nodeList; >+ nsresult rv = modelElem->GetElementsByTagNameNS(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS), >+ NS_LITERAL_STRING("instance"), >+ getter_AddRefs(nodeList)); indentation. >+++ extensions/xforms/nsXFormsUtils.h 17 Feb 2005 22:41:34 -0000 >@@ -330,6 +330,11 @@ >+ >+ static NS_HIDDEN_(nsresult) GetInstanceNodeForData(nsIDOMNode *aInstanceDataNode, >+ nsIModelElementPrivate *aModel, >+ nsIDOMNode **aInstanceNode); >+ Indent arguments, get rid of the extra space and add a documentation for the function. Nits all of them. Fix them before check in, and I'm happy. r=me.
Attachment #174617 - Flags: review?(allan) → review+
checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: