You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "jean-christophe.pazzaglia (JIRA)" <xm...@xml.apache.org> on 2004/12/14 20:03:02 UTC

[jira] Created: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Default behavior of  Factory.parse (or set )
--------------------------------------------

         Key: XMLBEANS-93
         URL: http://nagoya.apache.org/jira/browse/XMLBEANS-93
     Project: XMLBeans
        Type: Improvement
  Components: XmlObject  
    Versions: Version 1.0.3    
    Reporter: jean-christophe.pazzaglia
    Priority: Minor


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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "jean-christophe.pazzaglia (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-93?page=all ]

jean-christophe.pazzaglia updated XMLBEANS-93:
----------------------------------------------

    Attachment: Jira93.java

Here is a junit test  showing the problem;
hopefully 2.1 (unlike 1.0.x afaik) seems 
to enable to use the XMLOptions

=> since the XMLOptions arg solve the issue 
(but in an unatural way IMHO) 

Thanks 
jc


> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>          Key: XMLBEANS-93
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-93
>      Project: XMLBeans
>         Type: Improvement
>   Components: XmlObject
>     Versions: Version 1.0.3
>     Reporter: jean-christophe.pazzaglia
>     Assignee: Yana Kadiyska
>     Priority: Minor
>      Fix For: TBD
>  Attachments: Jira93.java, Jira93.java, jira-93.xsd
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Assigned: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "Jacob Danner (JIRA)" <xm...@xml.apache.org>.
     [ 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: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "Yana Kadiyska (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-93?page=all ]

Yana Kadiyska updated XMLBEANS-93:
----------------------------------

    Attachment: jira-93.xsd
                Jira93.java

Yana's attempt to repro bug

> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>          Key: XMLBEANS-93
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-93
>      Project: XMLBeans
>         Type: Improvement
>   Components: XmlObject
>     Versions: Version 1.0.3
>     Reporter: jean-christophe.pazzaglia
>     Assignee: Yana Kadiyska
>     Priority: Minor
>      Fix For: TBD
>  Attachments: Jira93.java, jira-93.xsd
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "Yana Kadiyska (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-93?page=comments#action_12313527 ] 

Yana Kadiyska commented on XMLBEANS-93:
---------------------------------------

I am not sure I understand the problem correctly. Attached is a "dumbed" down test and a simple schema...The code behaves correctly as of SVN 190504...could you fix the sample/ provide your own so we can repro the bug? ( I am running against branch 1.x in SVN at the revision above)

> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>          Key: XMLBEANS-93
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-93
>      Project: XMLBeans
>         Type: Improvement
>   Components: XmlObject
>     Versions: Version 1.0.3
>     Reporter: jean-christophe.pazzaglia
>     Assignee: Yana Kadiyska
>     Priority: Minor
>      Fix For: TBD
>  Attachments: Jira93.java, jira-93.xsd
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "Yana Kadiyska (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-93?page=all ]

Yana Kadiyska updated XMLBEANS-93:
----------------------------------

    Comment: was deleted

> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>          Key: XMLBEANS-93
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-93
>      Project: XMLBeans
>         Type: Improvement
>   Components: XmlObject
>     Versions: Version 1.0.3
>     Reporter: jean-christophe.pazzaglia
>     Assignee: Yana Kadiyska
>     Priority: Minor
>      Fix For: TBD
>  Attachments: Jira93.java, jira-93.xsd
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "Cezar Andrei (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-93?page=all ]

Cezar Andrei updated XMLBEANS-93:
---------------------------------

      Assign To: Yana Kadiyska  (was: Cezar Andrei)
    Fix Version: TBD

> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>          Key: XMLBEANS-93
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-93
>      Project: XMLBeans
>         Type: Improvement
>   Components: XmlObject
>     Versions: Version 1.0.3
>     Reporter: jean-christophe.pazzaglia
>     Assignee: Yana Kadiyska
>     Priority: Minor
>      Fix For: TBD

>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Assigned: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "Jacob Danner (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-93?page=history ]

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

    Assign To: Jacob Danner

Can you verify this is still an issue in v2?

> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>          Key: XMLBEANS-93
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-93
>      Project: XMLBeans
>         Type: Improvement
>   Components: XmlObject
>     Versions: Version 1.0.3
>     Reporter: jean-christophe.pazzaglia
>     Assignee: Jacob Danner
>     Priority: Minor

>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-93) Default behavior of Factory.parse (or set )

Posted by "jean-christophe.pazzaglia (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-93?page=comments#action_12357979 ] 

jean-christophe.pazzaglia commented on XMLBEANS-93:
---------------------------------------------------

Dear all,

I managed to move from 1.0.4 to 2.1 today,
however this issue still exist in 2.1.

IMHO the Yana test is a bit too simple 
since it does use a  simple type for signature
allowing to use xset instead of set,

it is even more problematic if the signature is an array
(e.g. I did not find a way arounfd)
I'm modifying the yana test and will come back to you



Thanks in advance,

jc


> Default behavior of  Factory.parse (or set )
> --------------------------------------------
>
>          Key: XMLBEANS-93
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-93
>      Project: XMLBeans
>         Type: Improvement
>   Components: XmlObject
>     Versions: Version 1.0.3
>     Reporter: jean-christophe.pazzaglia
>     Assignee: Yana Kadiyska
>     Priority: Minor
>      Fix For: TBD
>  Attachments: Jira93.java, jira-93.xsd
>
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org