[ 
https://issues.apache.org/jira/browse/XMLBEANS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jacob Danner reassigned XMLBEANS-93:
------------------------------------

    Assignee: Jacob Danner  (was: Yana Kadiyska)

> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>                 Key: XMLBEANS-93
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-93
>             Project: XMLBeans
>          Issue Type: Improvement
>          Components: XmlObject
>    Affects Versions: Version 1.0.3
>            Reporter: jean-christophe.pazzaglia
>         Assigned To: Jacob Danner
>            Priority: Minor
>             Fix For: TBD
>
>         Attachments: jira-93.xsd, Jira93.java, Jira93.java
>
>
> Dear XmlBeaner,
> I find the following behavior rather 'unnatural':
> if you do have a DOM element (likely to come from another library
> which doesnot use xmlbean) and you want to 'plug'-it with your 
> XML-Bean structure it does not work 'out of the box' (even if the types
> are compatible !?!) and moreover produce non valid XML !
> It looks trivial:
> let's imagine that you want to add a signature (using xml-security):
> myXMLBean.setSignature( SignatureType.Factory.parse(sig.getElement())); // 
> compile
> this will generate :
> <myXMLBean>
> <xd:Signature xmlns:xd="http://www.w3.org/2000/09/xmldsig#";>
>  <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#";>
> ...
> </myXMLBean>
> while you expect :
> <myXMLBean>
> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#";>
> ...
> </myXMLBean>
> in order to make it you should use
> XmlOptions opts = new XmlOptions();
> opts.setLoadReplaceDocumentElement(null);
> myXMLBean.setSignature( 
> SignatureType.Factory.parse(sig.getElement(),xmlopts)); 
> looks rather odd to me ...
> jc

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to