You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Alan Beccati <be...@meeo.it> on 2007/06/11 17:02:23 UTC

xsd2inst optional elements

Hi all,
i run xsd2inst tool against a schema and for leaf elemens with
minOccours set to zero it prints out only the the <!--Optional:--> or
<!--Zero or more repetitions:--> comments without an instance of the
element while optional elements containing other elements (non leaf
elements) are printed out below the comments.

I was wondering if there is a way to make xsd2inst print out the actual
optional elements when they occour as leaf in the schema file with the
aforementioned commands immediately above the actual optional elements.

I searched the documentation without finding any command line option for
setting this behaviour, is this behaviour by design or have i found out
a tool bug?

best regards.
A1an



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


Re: xsd2inst optional elements

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
I don't think there is any optional behavior on xsd2inst that you can
set (other than the root element name).

If I understand correctly what you are saying, then it would be bug, but
I just tried a very simple example and it worked for me:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="type">
    <xs:sequence>
      <xs:element name="a" minOccurs="0" type="xs:string"/>
      <xs:element name="b" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="root" type="type"/>

</xs:schema>

output:

<root>
  <!--Optional:-->
  <a>string</a>
  <b>string</b>
</root>

Radu

On Mon, 2007-06-11 at 08:02 -0700, Alan Beccati wrote:
> Hi all,
> i run xsd2inst tool against a schema and for leaf elemens with
> minOccours set to zero it prints out only the the <!--Optional:--> or
> <!--Zero or more repetitions:--> comments without an instance of the
> element while optional elements containing other elements (non leaf
> elements) are printed out below the comments.
> 
> I was wondering if there is a way to make xsd2inst print out the
> actual
> optional elements when they occour as leaf in the schema file with the
> aforementioned commands immediately above the actual optional
> elements.
> 
> I searched the documentation without finding any command line option
> for
> setting this behaviour, is this behaviour by design or have i found
> out
> a tool bug?
> 
> best regards.
> A1an
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

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