You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Adam Flinton <ad...@nhs.net> on 2009/07/13 15:39:20 UTC

Announce: Ant task for creating instances from XML (W3C) Schema

Dear All,

A new tool:

https://ant-tasks.projects.openhealthtools.org/source/browse/*checkout*/ant-tasks/trunk/AntTask-GenerateXML/index.html

An ant task which uses XMLbeans to create example XML instances from a
schema.

See:

https://ant-tasks.projects.openhealthtools.org/source/browse/*checkout*/ant-tasks/trunk/AntTask-GenerateXML/documentation/UserGuide.html

For the list of properties you must of can set.

Installation (including where to download the binary/zip file:

https://ant-tasks.projects.openhealthtools.org/source/browse/*checkout*/ant-tasks/trunk/AntTask-GenerateXML/documentation/Installation.html

It is especially useful for looking a pieces of schema as you can set
the element you wish to use as the root one.

It will use the values from enumerations are the fixed/default values
for attributes and elements if they are set.

It obeys the XML type system with the exception of regex/patterns.

If anyone knows of some Open Source  Java based "example from Regex"
code then please let me know as the one thing it is lacking is the
ability to create examples from patterns.

XMLBean info:

Differences with the std XML beans SampleXMLUtil:

Added :

In addition to the std settings you can set:

    public int numRepeat  - Sets the number of repeats where more than
one lement is allowed. Will work with the minOccurs and MaxOccurs is
those are set.
    public boolean addOptE - Add optional Elements
    public boolean addOptAtt = Add optional Attributes

I also check Element.getDefaultText() such that if an element has some
default text set in the schema it will use that.

I removed all the soap stuff (e.g. soapEnc) as it was not required.

If anyone wants to integrate it into the std XML Beans code base
etc.......then....it is Open Source etc.

If anyone finds any bugs/wants any new features then....it is Open
source etc.etc.

Adam




********************************************************************************************************************

This message may contain confidential information. If you are not the intended recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents:
to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSI recipients
NHSmail provides an email address for your career in the NHS and can be accessed anywhere
For more information and to find out how you can switch, visit www.connectingforhealth.nhs.uk/nhsmail

********************************************************************************************************************


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


Re: two similar xsd in the same wsdl databinded with xmlbean in axis2

Posted by Amila Suriarachchi <am...@gmail.com>.
On Thu, Jan 14, 2010 at 7:35 PM, Bartolomeo Nicolotti
<bn...@siapcn.it>wrote:

>  Hello,
>
> we're using xmlbean to parse xmls as an axis2 databinding for travel
> industries web services
>
> A web service we query has different version of the same kind of xml
>
> AirAvailability_8
> AirAvailability_9
>
>
> Is it possible to use xmlbean data binding with only one wsdl that has both
> the kind of xml, i.e. something like:
>
> ...
>           <s:include schemaLocation="AirAvailability_8.xsd"/>
>           <s:include schemaLocation="AirAvailability_9.xsd"/>
>
> <s:element name="SubmitXml">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0" name="Profile" type="s:string"/>
> <s:element maxOccurs="1" minOccurs="0" name="Request">
> <s:complexType>
> <s:sequence>
>             <s:element maxOccurs="1" minOccurs="0"
> name="LocalDateTimeCT_6_0"  type="s0:LocalDateTimeCT_6_0Type"/>
>                                     <s:element maxOccurs="1" minOccurs="0"
> name="AirAvailability_8"  type="s0:AirAvailability_8Type"/>
>                                     <s:element maxOccurs="1" minOccurs="0"
> name="AirAvailability_9"  type="s0:AirAvailability_9Type"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:sequence>
> </s:complexType>
> </s:element>
> ....
>
> My doubt is that this two kinds of xml have, oviously many similiar tags,
> won't these conflict?
>

yes. if they have the same target namespace.

thanks,
Amila.

>
> Many many thanks
>
> Best regards.
>
> Bartolomeo Nicolotti.
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: two similar xsd in the same wsdl databinded with xmlbean in axis2

Posted by Amila Suriarachchi <am...@gmail.com>.
On Thu, Jan 14, 2010 at 7:35 PM, Bartolomeo Nicolotti
<bn...@siapcn.it>wrote:

>  Hello,
>
> we're using xmlbean to parse xmls as an axis2 databinding for travel
> industries web services
>
> A web service we query has different version of the same kind of xml
>
> AirAvailability_8
> AirAvailability_9
>
>
> Is it possible to use xmlbean data binding with only one wsdl that has both
> the kind of xml, i.e. something like:
>
> ...
>           <s:include schemaLocation="AirAvailability_8.xsd"/>
>           <s:include schemaLocation="AirAvailability_9.xsd"/>
>
> <s:element name="SubmitXml">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0" name="Profile" type="s:string"/>
> <s:element maxOccurs="1" minOccurs="0" name="Request">
> <s:complexType>
> <s:sequence>
>             <s:element maxOccurs="1" minOccurs="0"
> name="LocalDateTimeCT_6_0"  type="s0:LocalDateTimeCT_6_0Type"/>
>                                     <s:element maxOccurs="1" minOccurs="0"
> name="AirAvailability_8"  type="s0:AirAvailability_8Type"/>
>                                     <s:element maxOccurs="1" minOccurs="0"
> name="AirAvailability_9"  type="s0:AirAvailability_9Type"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:sequence>
> </s:complexType>
> </s:element>
> ....
>
> My doubt is that this two kinds of xml have, oviously many similiar tags,
> won't these conflict?
>

yes. if they have the same target namespace.

thanks,
Amila.

>
> Many many thanks
>
> Best regards.
>
> Bartolomeo Nicolotti.
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

two similar xsd in the same wsdl databinded with xmlbean in axis2

Posted by Bartolomeo Nicolotti <bn...@siapcn.it>.
Hello,

we're using xmlbean to parse xmls as an axis2 databinding for travel
industries web services

A web service we query has different version of the same kind of xml

AirAvailability_8
AirAvailability_9


Is it possible to use xmlbean data binding with only one wsdl that has
both the kind of xml, i.e. something like:

...
          <s:include schemaLocation="AirAvailability_8.xsd"/>
          <s:include schemaLocation="AirAvailability_9.xsd"/>

			<s:element name="SubmitXml">
				<s:complexType>
					<s:sequence>
						<s:element maxOccurs="1" minOccurs="0" name="Profile"
type="s:string"/>
						<s:element maxOccurs="1" minOccurs="0" name="Request">
							<s:complexType>
								<s:sequence>
            						<s:element maxOccurs="1" minOccurs="0"
name="LocalDateTimeCT_6_0"  type="s0:LocalDateTimeCT_6_0Type"/>
                                    <s:element maxOccurs="1"
minOccurs="0" name="AirAvailability_8"
type="s0:AirAvailability_8Type"/>
                                    <s:element maxOccurs="1"
minOccurs="0" name="AirAvailability_9"
type="s0:AirAvailability_9Type"/>
								</s:sequence>
							</s:complexType>
						</s:element>
					</s:sequence>
				</s:complexType>
			</s:element>
....

My doubt is that this two kinds of xml have, oviously many similiar
tags, won't these conflict?

Many many thanks

Best regards.

Bartolomeo Nicolotti.


two similar xsd in the same wsdl databinded with xmlbean in axis2

Posted by Bartolomeo Nicolotti <bn...@siapcn.it>.
Hello,

we're using xmlbean to parse xmls as an axis2 databinding for travel
industries web services

A web service we query has different version of the same kind of xml

AirAvailability_8
AirAvailability_9


Is it possible to use xmlbean data binding with only one wsdl that has
both the kind of xml, i.e. something like:

...
          <s:include schemaLocation="AirAvailability_8.xsd"/>
          <s:include schemaLocation="AirAvailability_9.xsd"/>

			<s:element name="SubmitXml">
				<s:complexType>
					<s:sequence>
						<s:element maxOccurs="1" minOccurs="0" name="Profile"
type="s:string"/>
						<s:element maxOccurs="1" minOccurs="0" name="Request">
							<s:complexType>
								<s:sequence>
            						<s:element maxOccurs="1" minOccurs="0"
name="LocalDateTimeCT_6_0"  type="s0:LocalDateTimeCT_6_0Type"/>
                                    <s:element maxOccurs="1"
minOccurs="0" name="AirAvailability_8"
type="s0:AirAvailability_8Type"/>
                                    <s:element maxOccurs="1"
minOccurs="0" name="AirAvailability_9"
type="s0:AirAvailability_9Type"/>
								</s:sequence>
							</s:complexType>
						</s:element>
					</s:sequence>
				</s:complexType>
			</s:element>
....

My doubt is that this two kinds of xml have, oviously many similiar
tags, won't these conflict?

Many many thanks

Best regards.

Bartolomeo Nicolotti.