[ 
https://issues.apache.org/jira/browse/WSCOMMONS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612379#action_12612379
 ] 

Takahide Nogayama commented on WSCOMMONS-360:
---------------------------------------------

I agree the solution to expand OMSE as late as possible. Let me confirm my 
understanding. Currently we have five constructors in OMSE below.

(1) public OMSourcedElementImpl(String localName, OMNamespace ns, OMFactory 
factory, OMDataSource source);
(2) public OMSourcedElementImpl(QName qName, OMFactory factory, OMDataSource 
source);
(3) public OMSourcedElementImpl(String localName, OMNamespace ns, OMContainer 
parent, OMFactory factory);
(4) public OMSourcedElementImpl(String localName, OMNamespace ns, OMContainer 
parent, OMXMLParserWrapper builder, OMFactory factory);
(5) public OMSourcedElementImpl(String localName, OMNamespace ns, OMFactory 
factory);

If one of (1), (3), (4), and (5) is used, OMSE creater does not know the 
prefix, or prefix is "". The OMSE should be expanded by using Rich's solution 
when prefix is needed.

IF (2) is used, OMSE creater knows the prefix beforehand. The OMSE should not 
be expanded when the prefix is needed. becuase the first prefix and the second 
prefix (it appears at serialization) are the same.
That is, If the prefix in QName is different from the second prefix, (we can 
detect this at "forceExpand()") then the forceExpand should throw 
exception("prefix mismatch"). To avoid expantion for the prefix, if the OMSE 
creater knows that the prefix will be used, then the creater uses constructor 
(2).

Is my understanding correct?


>  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.

Reply via email to