[
https://issues.apache.org/jira/browse/WSCOMMONS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611714#action_12611714
]
Rich Scheuerle commented on WSCOMMONS-360:
------------------------------------------
Primary Problem:
An OMSourcedElement is created with a backing OMDataSource. The namespace and
local part are known at the point of creation. However the prefix may not be
known.
(Example, the namespace and local part are known for a JAXB object, but we
don't know the prefix that will be used).
Possible Solution:
The OMSE getNamespace() method should return a special OMNamespace.
The OMNamespace.getPrefix() method can then be coded to obtain the prefix (if
not known) from the OMSE. This will defer the expansion of the
OMSE until the prefix is actually requested.
Secondary Problem:
This issue is caused by an OMSE wrapping a JAXB object. In such cases, we
don't know the prefix. If we implement the solution above, we will still get
OMSE expansion when the getPrefix code is queried.
Secondary Solution:
Some JAXB implementations (i.e. Sun) provide vendor properties that control the
prefix>namespace mapping when marshalling. We could use such a property in the
Axis2 JAXB datasource layer to ensure that a specific prefix is used. Thus we
can use this information to get the prefix information without causing
expansion.
> Prefix mismatch of OMSourcedElement
> ------------------------------------
>
> Key: WSCOMMONS-360
> URL: https://issues.apache.org/jira/browse/WSCOMMONS-360
> Project: WS-Commons
> Issue Type: Improvement
> Components: AXIOM
> Reporter: Davanum Srinivas
> Assignee: Rich Scheuerle
> Priority: Critical
>
> Discussion here - http://markmail.org/message/ks7taa4upual3ufj
> ============== Text from initial email ==================
> Hi folks,
> I am facing prefix mismatch problem of OMSourcedElement. If we get a
> prefix from non-expanded OMSE by using OMSE.getNamespace().getPrefix(),
> the returned prefix is "". But if we get the prefix from expanded OMSE,
> then the returned prefix is "ns1". The first default OMNamespace is set by
> OMSE creater (can be outside of axiom and axis2) through constructor
> argument, The second OMNamespace is created from OMDatasource when it is
> expanded. Since these two OMNamespace are created by different ways, the
> prefixes can be mismatch.
> OMSourcedElement should return the same data regardless of whether it is
> expanded or not. I think the OMNamespace should not be provided by
> Constructor, but should be provided by OMDataSource to avoid such prefix
> mismatch, otherwise we have to expand OMSourcedElement when getNamespace()
> is invoked. I am not sure there are other ways to avoid this problem...
> ============== Text from initial email ==================
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.