logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Problems with schema2XForms converter tool: msg#00003

Subject: Re: Problems with schema2XForms converter tool

Hi,

It seems there's a bug in castor: it doesn't return a simple type for attributes where none is specified in the schema (in the XMLSchema spec it is specified that xs:anySimpleType should be used when none is provided).
I solved the problem in the CVS version of chiba, by setting the type to string when there is no type.
So now it should work with the CVS version.

Regards,

Sophie


"Paolo C." <paoloxforms-Qt13gs6zZMY@xxxxxxxxxxxxxxxx>
Sent by: chiba-developer-admin@xxxxxxxxxxxxxxxxxxxxx

31/10/2003 16:35

       
        To:        chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
        cc:        
        Subject:        [Chiba-developer] Problems with schema2XForms converter tool



Hi,

I'm evaluating the schema2XForms tool and I'm having
trouble with an example I have built, inspired by the
first example given in the "XForms essentials" draft
available here
http://dubinko.info/writing/xforms/book.html#id2800591
(see the following files for details).

I would like to know the limitations of this tool
(among others, does it support schemas involving
multiple namespaces ?)
What should I consider its status to be (alpha, beta,
etc.) ?


The schema and instance I'm using are valid and
"rather" simple, but I'm getting this error :

java.lang.NullPointerException
       at
org.chiba.tools.schemabuilder.BaseSchemaFormBuilder.startBindElement(BaseSchemaFormBuilder.java:349)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addSimpleType(AbstractSchemaFormBuilder.java:627)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addSimpleType(AbstractSchemaFormBuilder.java:720)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addAttributeSet(AbstractSchemaFormBuilder.java:1622)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addComplexTypeChildren(AbstractSchemaFormBuilder.java:1125)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addComplexType(AbstractSchemaFormBuilder.java:1050)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addElement(AbstractSchemaFormBuilder.java:1465)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addGroup(AbstractSchemaFormBuilder.java:1590)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addComplexTypeChildren(AbstractSchemaFormBuilder.java:1130)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addComplexType(AbstractSchemaFormBuilder.java:1050)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addElement(AbstractSchemaFormBuilder.java:1465)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addGroup(AbstractSchemaFormBuilder.java:1590)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addComplexTypeChildren(AbstractSchemaFormBuilder.java:1130)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addComplexType(AbstractSchemaFormBuilder.java:1050)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.addElement(AbstractSchemaFormBuilder.java:1465)
       at
org.chiba.tools.schemabuilder.AbstractSchemaFormBuilder.buildForm(AbstractSchemaFormBuilder.java:546)
       at
org.chiba.tools.schemabuilder.Schema2XForms.execute(Schema2XForms.java:191)
       at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
       at
org.apache.tools.ant.Task.perform(Task.java:341)
       at
org.apache.tools.ant.Target.execute(Target.java:309)
       at
org.apache.tools.ant.Target.performTasks(Target.java:336)
       at
org.apache.tools.ant.Project.executeTarget(Project.java:1339)
       at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
       at
org.apache.tools.ant.Main.runBuild(Main.java:609)
       at
org.apache.tools.ant.Main.start(Main.java:196)
       at
org.apache.tools.ant.Main.main(Main.java:235)


The following files ubl-instance.xml and ubl_po.xsd
are valid, according to XMLSpy validation.

Thank you in advance if someone can help.



-------------- ubl-instance.xml -------------------

<?xml version="1.0" encoding="UTF-8"?>

<Order xmlns="ubl_purchaseOrder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="ubl_purchaseOrder
ubl_po.xsd">
                <ID/>
                <IssueDate/>
                <LineExtensionTotalAmount currencyID="USD"/>
                <BuyerParty>
                                 <ID/>
                                 <PartyName>
                                                  <Name/>
                                 </PartyName>
                                 <Address>
                                                  <ID/>
                                                  <Street/>
                                                  <CityName/>
                                                  <PostalZone/>
                                                  <CountrySub-Entity/>
                                 </Address>
                                 <BuyerContact>
                                                  <ID/>
                                                  <Name/>
                                 </BuyerContact>
                </BuyerParty>
                <SellerParty>
                                 <ID/>
                                 <PartyName>
                                                  <Name/>
                                 </PartyName>
                                 <Address>
                                                  <ID/>
                                                  <Street/>
                                                  <CityName/>
                                                  <CountrySub-Entity/>
                                 </Address>
                </SellerParty>
                <DeliveryTerms>
                                 <ID/>
                                 <SpecialTerms/>
                </DeliveryTerms>
                <OrderLine>
                                 <BuyersID/>
                                 <SellersID/>
                                 <LineExtensionAmount currencyID=""/>
                                 <Quantity unitCode="">1</Quantity>
                                 <Item>
                                                  <ID/>
                                                  <Description>Enter description here</Description>
                                                  <SellersItemIdentification>
                                                                   <ID>Enter part number here</ID>
                                                  </SellersItemIdentification>
                                                  <BasePrice>
                                                                   <PriceAmount currencyID="">0.00</PriceAmount>
                                                  </BasePrice>
                                 </Item>
                </OrderLine>
</Order>

-------------- ubl_po.xsd ---------------------

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="ubl_purchaseOrder"
xmlns:ubl_po="ubl_purchaseOrder"
xmlns:xs="http://www.w3.org/2001/XMLSchema"

elementFormDefault="qualified">
                <xs:element name="Order">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                                   <xs:element ref="ubl_po:IssueDate"/>
                                                                   <xs:element
ref="ubl_po:LineExtensionTotalAmount"/>
                                                                   <xs:element ref="ubl_po:BuyerParty"/>
                                                                   <xs:element ref="ubl_po:SellerParty"/>
                                                                   <xs:element ref="ubl_po:DeliveryTerms"/>
                                                                   <xs:element ref="ubl_po:OrderLine"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="IssueDate">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="LineExtensionTotalAmount">
                                 <xs:complexType>
                                                  <xs:attribute name="currencyID" type="xs:NCName"
use="required"/>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="BuyerParty">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                                   <xs:element ref="ubl_po:PartyName"/>
                                                                   <xs:element ref="ubl_po:Address"/>
                                                                   <xs:element ref="ubl_po:BuyerContact"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="BuyerContact">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                                   <xs:sequence>
                                                                                    <xs:element ref="ubl_po:Name"/>
                                                                   </xs:sequence>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="SellerParty">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                                   <xs:element ref="ubl_po:PartyName"/>
                                                                   <xs:element ref="ubl_po:Address"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="DeliveryTerms">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                                   <xs:element ref="ubl_po:SpecialTerms"/>
                                                  </xs:sequence>
                                 </xs:complexType>

                 </xs:element>
                <xs:element name="SpecialTerms">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="OrderLine">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:BuyersID"/>
                                                                   <xs:element ref="ubl_po:SellersID"/>
                                                                   <xs:element ref="ubl_po:LineExtensionAmount"/>
                                                                   <xs:element ref="ubl_po:Quantity"/>
                                                                   <xs:element ref="ubl_po:Item"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="BuyersID">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="SellersID">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="LineExtensionAmount">
                                 <xs:complexType>
                                                  <xs:attribute name="currencyID" use="required"/>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="Quantity">
                                 <xs:complexType>
                                                  <xs:simpleContent>
                                                                   <xs:extension base="xs:integer">
                                                                                    <xs:attribute name="unitCode" use="required"/>
                                                                   </xs:extension>
                                                  </xs:simpleContent>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="Item">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                                   <xs:element ref="ubl_po:Description"/>
                                                                   <xs:element
ref="ubl_po:SellersItemIdentification"/>
                                                                   <xs:element ref="ubl_po:BasePrice"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="Description" type="xs:string"/>
                <xs:element name="SellersItemIdentification">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                                 <!--type="ubl_po:ID"/-->
                </xs:element>
                <xs:element name="BasePrice">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:PriceAmount"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="PriceAmount">
                                 <xs:complexType>
                                                  <xs:simpleContent>
                                                                   <xs:extension base="xs:decimal">
                                                                                    <xs:attribute name="currencyID" use="required"/>
                                                                   </xs:extension>
                                                  </xs:simpleContent>
                                 </xs:complexType>
                </xs:element>
                <!--xs:complexType name="ID">                <xs:sequence>                        <xs:element ref="ubl_po:ID"/>                </xs:sequence>        </xs:complexType-->
                <xs:element name="ID" type="xs:string"/>
                <xs:element name="PartyName">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:Name"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="Address">
                                 <xs:complexType>
                                                  <xs:sequence>
                                                                   <xs:element ref="ubl_po:ID"/>
                                                                   <xs:element ref="ubl_po:Street"/>
                                                                   <xs:element ref="ubl_po:CityName"/>
                                                                   <xs:element ref="ubl_po:PostalZone"
minOccurs="0"/>
                                                                   <xs:element ref="ubl_po:CountrySub-Entity"/>
                                                  </xs:sequence>
                                 </xs:complexType>
                </xs:element>
                <xs:element name="Street">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="CityName">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="PostalZone">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="CountrySub-Entity">
                                 <xs:complexType/>
                </xs:element>
                <xs:element name="Name">
                                 <xs:complexType/>
                </xs:element>
</xs:schema>


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________

Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer


<Prev in Thread] Current Thread [Next in Thread>