You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by "Mark Ford (JIRA)" <ji...@apache.org> on 2009/09/16 21:27:57 UTC
[jira] Created: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Namespace declarations not being copied in ASSIGN.replaceElement
----------------------------------------------------------------
Key: ODE-664
URL: https://issues.apache.org/jira/browse/ODE-664
Project: ODE
Issue Type: Bug
Components: BPEL Runtime
Affects Versions: 1.3.3, 1.3.4
Reporter: Mark Ford
Priority: Critical
The following line in ASSIGN.replaceElement looks wrong:
DOMUtils.copyNSContext(ptr, replacement);
I think it should be:
DOMUtils.copyNSContext(src, replacement);
The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Mark Ford (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756239#action_12756239 ]
Mark Ford commented on ODE-664:
-------------------------------
Also, I didn't mention it before but I am not using "keepSrcElement"
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "David Carver (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854771#action_12854771 ]
David Carver commented on ODE-664:
----------------------------------
Mark I'm assuming from your example:
<ns1:sourceNode xmlns:ns1="namespace1" xmlns:ns:2="namespace2">
<ns2:sourceChild/>
</ns1:sourceNode>
Should actually be:
<ns1:sourceNode xmlns:ns1="namespace1" xmlns:ns2="namespace2">
<ns2:sourceChild/>
</ns1:sourceNode>
As there is an extra : in the declaration for the second namespace.
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
> Fix For: 1.3.5
>
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Alexis Midon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexis Midon updated ODE-664:
-----------------------------
Fix Version/s: 1.3.5
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
> Fix For: 1.3.5
>
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Mark Ford (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Ford reopened ODE-664:
---------------------------
I didn't attach a test case but will put one together when my project is done in a few weeks.
You are not copying the namespace declarations over. Please review the code and notice that the namespace declarations are explicitly skipped over in the for loop above and then never put on the target.
As for copying the namespace decls over from the to-spec, that's a violation of the RE strategy.
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Mark Ford (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756296#action_12756296 ]
Mark Ford commented on ODE-664:
-------------------------------
I am interested in the first bullet point as you correctly quoted from Section 8.4.2 of WS-BPEL 2.0.
"Replace the element at the destination with a copy of the entire element at the source, including [children] and [attribute] properties."
Full stop, no need to proceed further since the remaining bits are about keepSrcElementName.
For example:
Copying:
<ns1:sourceNode xmlns:ns1="namespace1" xmlns:ns:2="namespace2">
<ns2:sourceChild/>
</ns1:sourceNode>
To:
<ns3:targetNode xmlns:ns3="namespace3" xmlns:ns4="namespace4">
<ns4:targetChild/>
</ns3:targetNode>
Should result in:
<ns3:targetNode xmlns:ns1="namespace1" xmlns:ns:2="namespace2" xmlns:ns3="namespace3">
<ns2:sourceChild/>
</ns3:targetNode>
But in ODE it results in:
<ns3:targetNode xmlns:ns3="namespace3">
<ns2:sourceChild/>
</ns3:targetNode>
The problem with the result in ODE is that it is missing the namespace declaration for <ns2:sourceChild>. This will cause problems when trying to parse the xml again. I ran into this exact issue and it took me a while to figure out where it was going wrong since I'm running ServiceMix and wasn't sure if the problem was in there or ODE.
To be fair, my original report above has no context or additional info for which I apologize. I'm pressed for time and banged out a few bugs while trying to get my app to work. I'll spend the extra couple of minutes next time to put together something more coherent, although a patch with unit tests isn't likely coming soon.
If you look at the replaceElement code in ASSIGN, you'll see that it skips over the namespace decls for the source node. It relies on a util method call below to copy the namespace decl from the target node onto the replacementElement. If you look at the history of the file, there was a change made to skip over the namespace declarations back in 2008 although I don't understand why.
My comment about the copying namespace declarations over from the to-spec onto the replacementElement being a violation of the RE strategy were secondary to the real bug which is not copying the source decls over. By copying over all of the namespace decls from the to-spec to the replacementElement you're doing something that isn't specified and in fact may inadvertently be changing the element's meaning. Not having looked at the namespace context propagation code, I'm not sure how it handles namespace collisions or encoded namespaces within text or CDATA but even if it worked perfectly, it seems unnecessary -- although again, a subtle issue which is minor in comparison to the original problem.
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Alex Boisvert (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Boisvert reassigned ODE-664:
---------------------------------
Assignee: Karthick Sankarachary
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Karthick Sankarachary (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Karthick Sankarachary resolved ODE-664.
---------------------------------------
Resolution: Won't Fix
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Karthick Sankarachary (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756227#action_12756227 ]
Karthick Sankarachary commented on ODE-664:
-------------------------------------------
We do adhere to the RE (replace-element-properties) rule that requires us to "replace the element at the destination with a copy of the entire element at the source, including [children] and [attribute] properties.", as you tell by looking at the calls to "importNode" that precede that line.
The line you are referring to ensures that the namespaces defined in the to-spec carry over to the copy of the target element that we create in ASSIGN.replaceElement.
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ODE-664) Namespace declarations not being copied
in ASSIGN.replaceElement
Posted by "Karthick Sankarachary (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ODE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756242#action_12756242 ]
Karthick Sankarachary commented on ODE-664:
-------------------------------------------
Maybe we're talking about different things here. Can you indicate the violation in the RE strategy that is described below?
RE (Replace-Element-properties):
o Replace the element at the destination with a copy of the entire element at the source, including [children] and [attribute] properties.
An optional keepSrcElementName attribute is provided to further refine the behavior. [SA00042] It is only applicable when the results of both from-spec and to-spec are EIIs, and MUST NOT be explicitly set in other cases. A WS-BPEL processor MAY enforce this checking through static analysis of the expression/query language. If a violation is detected during runtime, a bpel:selectionFailure fault MUST be thrown.
§ When the keepSrcElementName attribute is set to "no", the name (i.e. [namespace name] and [local name] properties) of the original destination element is used as the name of the resulting element. This is the default value.
§ When the keepSrcElementName attribute is set to "yes", the source element name is used as the name of the resulting destination element.
When the keepSrcElementName attribute is set to "yes" and the destination element is the Document EII of an element-based variable or an element-based part of a WSDL message-type-based variable, a WS-BPEL processor MUST make sure the name of the source element belongs to the substitutionGroup of the destination element used in the element variable declaration or WSDL part definition. The substitutionGroup relation is determined by XML Schemas known to the WS-BPEL processor. [SA00094] A WS-BPEL processor MAY enforce this checking through static analysis of the expression/query language. If a violation is detected during runtime, a bpel:mismatchedAssignmentFailure fault MUST be thrown.
> Namespace declarations not being copied in ASSIGN.replaceElement
> ----------------------------------------------------------------
>
> Key: ODE-664
> URL: https://issues.apache.org/jira/browse/ODE-664
> Project: ODE
> Issue Type: Bug
> Components: BPEL Runtime
> Affects Versions: 1.3.3, 1.3.4
> Reporter: Mark Ford
> Assignee: Karthick Sankarachary
> Priority: Critical
>
> The following line in ASSIGN.replaceElement looks wrong:
> DOMUtils.copyNSContext(ptr, replacement);
> I think it should be:
> DOMUtils.copyNSContext(src, replacement);
> The rationale is that the RE strategy should copy the attributes from the source element to the target element. Without this change, you may end up with undeclared namespace prefixes in the output of your BPEL.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.