You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Andrey Utkin <ci...@gmail.com> on 2008/12/01 23:41:09 UTC
SDO - generating XSD from dynamic type
Hi,
I need to generate XSD for dynamic types. All works fine, but for DataType
properties represented by xsd:element (many==true or nullable==true) there
are no "type" attribute generated in xsd. So, that I can`t use generated xsd
to define the type in another context - the type information of such
properties is lost. Iam using XSDHelper.generate(List<Type>) method.
Does someone know how to generate XSD for dynamic types without losing type
information of such properties?
Thanks.
Re: SDO - generating XSD from dynamic type
Posted by haleh mahbod <hm...@gmail.com>.
Thank you.
On Tue, Dec 2, 2008 at 1:53 PM, Andrey Utkin <ci...@gmail.com> wrote:
> Hi Haleh,
>
> I have created JIRA issue:
> https://issues.apache.org/jira/browse/TUSCANY-2705
>
> Frank, thanks a lot for solution. It works for me.
>
> --
> Andrey
>
>
>
> On Wed, Dec 3, 2008 at 12:18 AM, haleh mahbod <hm...@gmail.com> wrote:
>
>> Hi Andrey,
>>
>> Are you going to create a JIRA for this and perhaps provide this patch?
>> If not, I'll put this in a JIRA.
>>
>> Haleh
>>
>> On Tue, Dec 2, 2008 at 7:01 AM, Frank Budinsky <fr...@ca.ibm.com>wrote:
>>
>>> Hi Andrey,
>>>
>>> I think there's a blatant bug in
>>> SchemaBuilder.addElement2ComplexType(...). It looks to me like the
>>> following if statement:
>>>
>>> if ( aProperty.isContainment() )
>>> {
>>>
>>>
>>> element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
>>> elementSchemaType.getLocalPart()));
>>> }
>>> else
>>> {
>>> if ( !aProperty.getType().isDataType() )
>>> {
>>> QName qName = typeTable.getSimpleSchemaTypeName("URI");
>>>
>>>
>>> element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
>>> qName.getLocalPart()));
>>> }
>>> }
>>>
>>> should look like this:
>>>
>>> if ( aProperty.isContainment() || aProperty.getType().isDataType()
>>> )
>>> {
>>>
>>>
>>> element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
>>> elementSchemaType.getLocalPart()));
>>> }
>>> else
>>> {
>>> if ( !aProperty.getType().isDataType() )
>>> {
>>> QName qName = typeTable.getSimpleSchemaTypeName("URI");
>>>
>>>
>>> element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
>>> qName.getLocalPart()));
>>> }
>>> }
>>>
>>> Frank
>>>
>>>
>>>
>>>
>>>
>>> "Andrey Utkin" <ci...@gmail.com>
>>> 12/01/2008 05:41 PM
>>> Please respond to
>>> user@tuscany.apache.org
>>>
>>>
>>> To
>>> user@tuscany.apache.org
>>> cc
>>>
>>> Subject
>>> SDO - generating XSD from dynamic type
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hi,
>>>
>>> I need to generate XSD for dynamic types. All works fine, but for
>>> DataType
>>> properties represented by xsd:element (many==true or nullable==true)
>>> there are no "type" attribute generated in xsd. So, that I can`t use
>>> generated xsd to define the type in another context - the type
>>> information
>>> of such properties is lost. Iam using XSDHelper.generate(List<Type>)
>>> method.
>>> Does someone know how to generate XSD for dynamic types without losing
>>> type information of such properties?
>>>
>>> Thanks.
>>>
>>>
>>
>
Re: SDO - generating XSD from dynamic type
Posted by Andrey Utkin <ci...@gmail.com>.
Hi Haleh,
I have created JIRA issue:
https://issues.apache.org/jira/browse/TUSCANY-2705
Frank, thanks a lot for solution. It works for me.
--
Andrey
On Wed, Dec 3, 2008 at 12:18 AM, haleh mahbod <hm...@gmail.com> wrote:
> Hi Andrey,
>
> Are you going to create a JIRA for this and perhaps provide this patch?
> If not, I'll put this in a JIRA.
>
> Haleh
>
> On Tue, Dec 2, 2008 at 7:01 AM, Frank Budinsky <fr...@ca.ibm.com> wrote:
>
>> Hi Andrey,
>>
>> I think there's a blatant bug in
>> SchemaBuilder.addElement2ComplexType(...). It looks to me like the
>> following if statement:
>>
>> if ( aProperty.isContainment() )
>> {
>>
>>
>> element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
>> elementSchemaType.getLocalPart()));
>> }
>> else
>> {
>> if ( !aProperty.getType().isDataType() )
>> {
>> QName qName = typeTable.getSimpleSchemaTypeName("URI");
>>
>> element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
>> qName.getLocalPart()));
>> }
>> }
>>
>> should look like this:
>>
>> if ( aProperty.isContainment() || aProperty.getType().isDataType()
>> )
>> {
>>
>>
>> element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
>> elementSchemaType.getLocalPart()));
>> }
>> else
>> {
>> if ( !aProperty.getType().isDataType() )
>> {
>> QName qName = typeTable.getSimpleSchemaTypeName("URI");
>>
>> element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
>> qName.getLocalPart()));
>> }
>> }
>>
>> Frank
>>
>>
>>
>>
>>
>> "Andrey Utkin" <ci...@gmail.com>
>> 12/01/2008 05:41 PM
>> Please respond to
>> user@tuscany.apache.org
>>
>>
>> To
>> user@tuscany.apache.org
>> cc
>>
>> Subject
>> SDO - generating XSD from dynamic type
>>
>>
>>
>>
>>
>>
>> Hi,
>>
>> I need to generate XSD for dynamic types. All works fine, but for DataType
>> properties represented by xsd:element (many==true or nullable==true)
>> there are no "type" attribute generated in xsd. So, that I can`t use
>> generated xsd to define the type in another context - the type information
>> of such properties is lost. Iam using XSDHelper.generate(List<Type>)
>> method.
>> Does someone know how to generate XSD for dynamic types without losing
>> type information of such properties?
>>
>> Thanks.
>>
>>
>
Re: SDO - generating XSD from dynamic type
Posted by haleh mahbod <hm...@gmail.com>.
Hi Andrey,
Are you going to create a JIRA for this and perhaps provide this patch?
If not, I'll put this in a JIRA.
Haleh
On Tue, Dec 2, 2008 at 7:01 AM, Frank Budinsky <fr...@ca.ibm.com> wrote:
> Hi Andrey,
>
> I think there's a blatant bug in
> SchemaBuilder.addElement2ComplexType(...). It looks to me like the
> following if statement:
>
> if ( aProperty.isContainment() )
> {
>
>
> element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
> elementSchemaType.getLocalPart()));
> }
> else
> {
> if ( !aProperty.getType().isDataType() )
> {
> QName qName = typeTable.getSimpleSchemaTypeName("URI");
>
> element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
> qName.getLocalPart()));
> }
> }
>
> should look like this:
>
> if ( aProperty.isContainment() || aProperty.getType().isDataType()
> )
> {
>
>
> element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
> elementSchemaType.getLocalPart()));
> }
> else
> {
> if ( !aProperty.getType().isDataType() )
> {
> QName qName = typeTable.getSimpleSchemaTypeName("URI");
>
> element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
> qName.getLocalPart()));
> }
> }
>
> Frank
>
>
>
>
>
> "Andrey Utkin" <ci...@gmail.com>
> 12/01/2008 05:41 PM
> Please respond to
> user@tuscany.apache.org
>
>
> To
> user@tuscany.apache.org
> cc
>
> Subject
> SDO - generating XSD from dynamic type
>
>
>
>
>
>
> Hi,
>
> I need to generate XSD for dynamic types. All works fine, but for DataType
> properties represented by xsd:element (many==true or nullable==true)
> there are no "type" attribute generated in xsd. So, that I can`t use
> generated xsd to define the type in another context - the type information
> of such properties is lost. Iam using XSDHelper.generate(List<Type>)
> method.
> Does someone know how to generate XSD for dynamic types without losing
> type information of such properties?
>
> Thanks.
>
>
Re: SDO - generating XSD from dynamic type
Posted by Frank Budinsky <fr...@ca.ibm.com>.
Hi Andrey,
I think there's a blatant bug in
SchemaBuilder.addElement2ComplexType(...). It looks to me like the
following if statement:
if ( aProperty.isContainment() )
{
element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
elementSchemaType.getLocalPart()));
}
else
{
if ( !aProperty.getType().isDataType() )
{
QName qName = typeTable.getSimpleSchemaTypeName("URI");
element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
qName.getLocalPart()));
}
}
should look like this:
if ( aProperty.isContainment() || aProperty.getType().isDataType()
)
{
element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
elementSchemaType.getLocalPart()));
}
else
{
if ( !aProperty.getType().isDataType() )
{
QName qName = typeTable.getSimpleSchemaTypeName("URI");
element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
qName.getLocalPart()));
}
}
Frank
"Andrey Utkin" <ci...@gmail.com>
12/01/2008 05:41 PM
Please respond to
user@tuscany.apache.org
To
user@tuscany.apache.org
cc
Subject
SDO - generating XSD from dynamic type
Hi,
I need to generate XSD for dynamic types. All works fine, but for DataType
properties represented by xsd:element (many==true or nullable==true)
there are no "type" attribute generated in xsd. So, that I can`t use
generated xsd to define the type in another context - the type information
of such properties is lost. Iam using XSDHelper.generate(List<Type>)
method.
Does someone know how to generate XSD for dynamic types without losing
type information of such properties?
Thanks.