IllegalArgumentException with CodeGen of imported schema including enumeration

View: New views
5 Messages — Rating Filter:   Alert me  

IllegalArgumentException with CodeGen of imported schema including enumeration

by jibx-users :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hello,

I'm not sure if this is another variant of JIBX-263, or a completely separate problem???  However, when I run CodeGen on Intuit's QuickBooks schemas, I get the following stack trace and the operation fails.

     [java] Exception in thread "main" java.lang.IllegalArgumentException
     [java]     at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:196)
     [java]     at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1251)
     [java]     at org.jibx.schema.codegen.ClassBuilder.addEnumConstant(ClassBuilder.java:351)
     [java]     at org.jibx.schema.codegen.EnumerationClassHolder.buildJava5Enumeration(EnumerationClassHolder.java:353)
     [java]     at org.jibx.schema.codegen.EnumerationClassHolder.generate(EnumerationClassHolder.java:162)
     [java]     at org.jibx.schema.codegen.ClassHolder.generateInner(ClassHolder.java:702)
     [java]     at org.jibx.schema.codegen.StructureClassHolder.generate(StructureClassHolder.java:2026)
     [java]     at org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:203)
     [java]     at org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:218)
     [java]     at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1402)
     [java]     at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:1652)

Here is the ant invocation I am using....

    <target name="qbXML" depends="prepare" description="Generates Code for qbXML requests">
        <path id="codegen_classpath">
            <fileset dir="${JIBX_HOME}/lib" includes="*.jar" />
            <pathelement location="bin" />
        </path>

        <java classname="org.jibx.schema.codegen.CodeGen" fork="yes"
                classpathref="codegen_classpath" failonerror="true">
            <arg value="-n"/>
            <arg value="com.foo.bar"/>
            <arg value="-s"/>
            <arg value="${srcDir}/xsd"/>
            <arg value="-t"/>
            <arg value="${srcDir}/generated/${srcDir}"/>
            <arg value="-v"/>
            <arg value="qbxmlops70.xsd"/>
        </java>
    </target>

I am using JiBX 1_2_1.

line 18 of the qbxmlops70.xsd includes the qbxml70.xsd file. 

 

<xsd:include schemaLocation="qbxml70.xsd"/>

 

The stack trace seems to stem from around line 1446 of the included qbxml70.xsd file which defines the GeneralSummaryReportType as a restricted SimpleType made of an enumeration. 

 

<xsd:element name="GeneralSummaryReportType">

            <xsd:simpleType>

                        <xsd:restriction base="ENUMTYPE">

                                    <xsd:enumeration value="BalanceSheetPrevYearComp"/>

                                    <xsd:enumeration value="BalanceSheetStandard"/>

                                    <xsd:enumeration value="BalanceSheetSummary"/>

                                    <xsd:enumeration value="CustomerBalanceSummary"/>

                                    <xsd:enumeration value="ExpenseByVendorSummary"/>

                                    <xsd:enumeration value="IncomeByCustomerSummary"/>

                                    <xsd:enumeration value="InventoryStockStatusByItem"/>

                                    <xsd:enumeration value="InventoryStockStatusByVendor"/>

                                    <xsd:enumeration value="IncomeTaxSummary"/>

                                    <xsd:enumeration value="InventoryValuationSummary"/>

                                    <xsd:enumeration value="PhysicalInventoryWorksheet"/>

                                    <xsd:enumeration value="ProfitAndLossByClass"/>

                                    <xsd:enumeration value="ProfitAndLossByJob"/>

                                    <xsd:enumeration value="ProfitAndLossPrevYearComp"/>

                                    <xsd:enumeration value="ProfitAndLossStandard"/>

                                    <xsd:enumeration value="ProfitAndLossYTDComp"/>

                                    <xsd:enumeration value="PurchaseByItemSummary"/>

                                    <xsd:enumeration value="PurchaseByVendorSummary"/>

                                    <xsd:enumeration value="SalesByCustomerSummary"/>

                                    <xsd:enumeration value="SalesByItemSummary"/>

                                    <xsd:enumeration value="SalesByRepSummary"/>

                                    <xsd:enumeration value="SalesTaxLiability"/>

                                    <xsd:enumeration value="SalesTaxRevenueSummary"/>

                                    <xsd:enumeration value="TrialBalance"/>

                                    <xsd:enumeration value="VendorBalanceSummary"/>

                        </xsd:restriction>

            </xsd:simpleType>

</xsd:element>

 

Note that ENUMTYPE restriction is defined in the qbxmltypes70.xsd included by qbxml70.xsd on line 17.  qbxmltypes70.xsd defines ENUMTYPE as

 

<xsd:simpleType name="ENUMTYPE">

  <xsd:restriction base="xsd:string">

  </xsd:restriction>

</xsd:simpleType>

 

I will happily forward the entire XSDs if needed, but they are a bit large.

 

Unfortunately, as these XSDs are defined by Intuit, I cannot change them.

 

I have had significant previous positive experience with JiBX, so this comes somewhat as a surprise to me.  Therefore, only as a data point to rule out structural problems with the QuickBooks schemas; I offer that the same xsds complete without errors when using XML-BEANS.  I would, of course, prefer to stick with JIBX if this can be resolved or worked around, however, this is presently a show stopper for us.

Any and all help will be greatly appreciated!

Thanks in advance for your help!

Todd


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users

Re: IllegalArgumentException with CodeGen of imported schema including enumeration

by DSosnoski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Should be working with the 1.2.2 code - I tried this out over the weekend.

  - Dennis


jibx-users@... wrote:

>
> Hello,
>
> I'm not sure if this is another variant of JIBX-263, or a completely
> separate problem???  However, when I run CodeGen on Intuit's
> QuickBooks schemas, I get the following stack trace and the operation
> fails.
>
>      [java] Exception in thread "main" java.lang.IllegalArgumentException
>      [java]     at
> org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:196)
>      [java]     at
> org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1251)
>      [java]     at
> org.jibx.schema.codegen.ClassBuilder.addEnumConstant(ClassBuilder.java:351)
>      [java]     at
> org.jibx.schema.codegen.EnumerationClassHolder.buildJava5Enumeration(EnumerationClassHolder.java:353)
>      [java]     at
> org.jibx.schema.codegen.EnumerationClassHolder.generate(EnumerationClassHolder.java:162)
>      [java]     at
> org.jibx.schema.codegen.ClassHolder.generateInner(ClassHolder.java:702)
>      [java]     at
> org.jibx.schema.codegen.StructureClassHolder.generate(StructureClassHolder.java:2026)
>      [java]     at
> org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:203)
>      [java]     at
> org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:218)
>      [java]     at
> org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1402)
>      [java]     at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:1652)
>
> Here is the ant invocation I am using....
>
>     <target name="qbXML" depends="prepare" description="Generates Code
> for qbXML requests">
>         <path id="codegen_classpath">
>             <fileset dir="${JIBX_HOME}/lib" includes="*.jar" />
>             <pathelement location="bin" />
>         </path>
>
>         <java classname="org.jibx.schema.codegen.CodeGen" fork="yes"
>                 classpathref="codegen_classpath" failonerror="true">
>             <arg value="-n"/>
>             <arg value="com.foo.bar"/>
>             <arg value="-s"/>
>             <arg value="${srcDir}/xsd"/>
>             <arg value="-t"/>
>             <arg value="${srcDir}/generated/${srcDir}"/>
>             <arg value="-v"/>
>             <arg value="qbxmlops70.xsd"/>
>         </java>
>     </target>
>
> I am using JiBX 1_2_1.
>
> line 18 of the qbxmlops70.xsd includes the qbxml70.xsd file.
>
>  
>
> <xsd:include schemaLocation="qbxml70.xsd"/>
>
>  
>
> The stack trace seems to stem from around line 1446 of the included
> qbxml70.xsd file which defines the GeneralSummaryReportType as a
> restricted SimpleType made of an enumeration.
>
>  
>
> <xsd:element name="GeneralSummaryReportType">
>
>             <xsd:simpleType>
>
>                         <xsd:restriction base="ENUMTYPE">
>
>                                     <xsd:enumeration
> value="BalanceSheetPrevYearComp"/>
>
>                                     <xsd:enumeration
> value="BalanceSheetStandard"/>
>
>                                     <xsd:enumeration
> value="BalanceSheetSummary"/>
>
>                                     <xsd:enumeration
> value="CustomerBalanceSummary"/>
>
>                                     <xsd:enumeration
> value="ExpenseByVendorSummary"/>
>
>                                     <xsd:enumeration
> value="IncomeByCustomerSummary"/>
>
>                                     <xsd:enumeration
> value="InventoryStockStatusByItem"/>
>
>                                     <xsd:enumeration
> value="InventoryStockStatusByVendor"/>
>
>                                     <xsd:enumeration
> value="IncomeTaxSummary"/>
>
>                                     <xsd:enumeration
> value="InventoryValuationSummary"/>
>
>                                     <xsd:enumeration
> value="PhysicalInventoryWorksheet"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossByClass"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossByJob"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossPrevYearComp"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossStandard"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossYTDComp"/>
>
>                                     <xsd:enumeration
> value="PurchaseByItemSummary"/>
>
>                                     <xsd:enumeration
> value="PurchaseByVendorSummary"/>
>
>                                     <xsd:enumeration
> value="SalesByCustomerSummary"/>
>
>                                     <xsd:enumeration
> value="SalesByItemSummary"/>
>
>                                     <xsd:enumeration
> value="SalesByRepSummary"/>
>
>                                     <xsd:enumeration
> value="SalesTaxLiability"/>
>
>                                     <xsd:enumeration
> value="SalesTaxRevenueSummary"/>
>
>                                     <xsd:enumeration
> value="TrialBalance"/>
>
>                                     <xsd:enumeration
> value="VendorBalanceSummary"/>
>
>                         </xsd:restriction>
>
>             </xsd:simpleType>
>
> </xsd:element>
>
>  
>
> Note that ENUMTYPE restriction is defined in the qbxmltypes70.xsd
> included by qbxml70.xsd on line 17.  qbxmltypes70.xsd defines ENUMTYPE as
>
>  
>
> <xsd:simpleType name="ENUMTYPE">
>
>   <xsd:restriction base="xsd:string">
>
>   </xsd:restriction>
>
> </xsd:simpleType>
>
>  
>
> I will happily forward the entire XSDs if needed, but they are a bit
> large.
>
>  
>
> Unfortunately, as these XSDs are defined by Intuit, I cannot change them.
>
>  
>
> I have had significant previous positive experience with JiBX, so this
> comes somewhat as a surprise to me.  Therefore, only as a data point
> to rule out structural problems with the QuickBooks schemas; I offer
> that the same xsds complete without errors when using XML-BEANS.  I
> would, of course, prefer to stick with JIBX if this can be resolved or
> worked around, however, this is presently a show stopper for us.
>
> Any and all help will be greatly appreciated!
>
> Thanks in advance for your help!
>
> Todd
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@...
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>  

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users

Re: IllegalArgumentException with CodeGen of imported schema including enumeration

by jibx-users :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dennis,

Sorry for the delay.  I finally had a chance to try this and it
does now appear to work in the 1_2_2_SNAPSHOT.  Thank you!  When
will this become an official release?

Also, on a related note, the QB schemas use a lot of unqualified
references (i.e. they do not define the includes for elements
that are in the same default namespace).  For example the
qbxmlops70.xsd contains:

<xsd:element name="SubscriberID" type="GUIDTYPE"/>

This references the GUIDTYPE defined in qbxmltypes70.xsd as:

<xsd:element name="SubscriberID" type="GUIDTYPE"/>

Both xsd files are defined to be in the same default namespace,
xmlns:xsd="http://www.w3.org/2001/XMLSchema".

However, the original files from QB do NOT include any
xsd:include statements to make the above reference explicit.
Unless I add the below <xsd:include> statements to explicitly
define all of these references, then the codegen operation fails.
 I needed to add:

<xsd:include schemaLocation="qbxmltypes70.xsd"/>
<xsd:include schemaLocation="qbxml70.xsd"/>
<xsd:include schemaLocation="qbxmlso70.xsd"/>

When I compile the same schemas with XMLBeans, I do not need to
add the <xsd:include> statements.  I understand that it is
'clearer' with them added, but these are Intuit provided schemas
that I do not feel comfortable changing in any way.

Should this work (without the includes I manually added) in
codegen as all are in the same namespace? If not, why does this
work for other tools?

TIA!

---------Original Message---------

Should be working with the 1.2.2 code - I tried this out over the
weekend.

  - Dennis


jibx-users@... wrote:
>
> Hello,
>
> I'm not sure if this is another variant of JIBX-263, or a
completely
> separate problem???  However, when I run CodeGen on Intuit's
> QuickBooks schemas, I get the following stack trace and the
operation
> fails.
>
>      [java] Exception in thread "main"
java.lang.IllegalArgumentException
>      [java]     at
>
org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:196)
>      [java]     at
> org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1251)
>      [java]     at
>
org.jibx.schema.codegen.ClassBuilder.addEnumConstant(ClassBuilder.java:351)
>      [java]     at
>
org.jibx.schema.codegen.EnumerationClassHolder.buildJava5Enumeration(EnumerationClassHolder.java:353)
>      [java]     at
>
org.jibx.schema.codegen.EnumerationClassHolder.generate(EnumerationClassHolder.java:162)
>      [java]     at
>
org.jibx.schema.codegen.ClassHolder.generateInner(ClassHolder.java:702)
>      [java]     at
>
org.jibx.schema.codegen.StructureClassHolder.generate(StructureClassHolder.java:2026)
>      [java]     at
>
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:203)
>      [java]     at
>
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:218)
>      [java]     at
> org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1402)
>      [java]     at
org.jibx.schema.codegen.CodeGen.main(CodeGen.java:1652)
>
> Here is the ant invocation I am using....
>
>     <target name="qbXML" depends="prepare"
description="Generates Code
> for qbXML requests">
>         <path id="codegen_classpath">
>             <fileset dir="${JIBX_HOME}/lib" includes="*.jar" />
>             <pathelement location="bin" />
>         </path>
>
>         <java classname="org.jibx.schema.codegen.CodeGen"
fork="yes"
>                 classpathref="codegen_classpath"
failonerror="true">

>             <arg value="-n"/>
>             <arg value="com.foo.bar"/>
>             <arg value="-s"/>
>             <arg value="${srcDir}/xsd"/>
>             <arg value="-t"/>
>             <arg value="${srcDir}/generated/${srcDir}"/>
>             <arg value="-v"/>
>             <arg value="qbxmlops70.xsd"/>
>         </java>
>     </target>
>
> I am using JiBX 1_2_1.
>
> line 18 of the qbxmlops70.xsd includes the qbxml70.xsd file.
>
>  
>
> <xsd:include schemaLocation="qbxml70.xsd"/>
>
>  
>
> The stack trace seems to stem from around line 1446 of the
included

> qbxml70.xsd file which defines the GeneralSummaryReportType as a
> restricted SimpleType made of an enumeration.
>
>  
>
> <xsd:element name="GeneralSummaryReportType">
>
>             <xsd:simpleType>
>
>                         <xsd:restriction base="ENUMTYPE">
>
>                                     <xsd:enumeration
> value="BalanceSheetPrevYearComp"/>
>
>                                     <xsd:enumeration
> value="BalanceSheetStandard"/>
>
>                                     <xsd:enumeration
> value="BalanceSheetSummary"/>
>
>                                     <xsd:enumeration
> value="CustomerBalanceSummary"/>
>
>                                     <xsd:enumeration
> value="ExpenseByVendorSummary"/>
>
>                                     <xsd:enumeration
> value="IncomeByCustomerSummary"/>
>
>                                     <xsd:enumeration
> value="InventoryStockStatusByItem"/>
>
>                                     <xsd:enumeration
> value="InventoryStockStatusByVendor"/>
>
>                                     <xsd:enumeration
> value="IncomeTaxSummary"/>
>
>                                     <xsd:enumeration
> value="InventoryValuationSummary"/>
>
>                                     <xsd:enumeration
> value="PhysicalInventoryWorksheet"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossByClass"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossByJob"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossPrevYearComp"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossStandard"/>
>
>                                     <xsd:enumeration
> value="ProfitAndLossYTDComp"/>
>
>                                     <xsd:enumeration
> value="PurchaseByItemSummary"/>
>
>                                     <xsd:enumeration
> value="PurchaseByVendorSummary"/>
>
>                                     <xsd:enumeration
> value="SalesByCustomerSummary"/>
>
>                                     <xsd:enumeration
> value="SalesByItemSummary"/>
>
>                                     <xsd:enumeration
> value="SalesByRepSummary"/>
>
>                                     <xsd:enumeration
> value="SalesTaxLiability"/>
>
>                                     <xsd:enumeration
> value="SalesTaxRevenueSummary"/>
>
>                                     <xsd:enumeration
> value="TrialBalance"/>
>
>                                     <xsd:enumeration
> value="VendorBalanceSummary"/>
>
>                         </xsd:restriction>
>
>             </xsd:simpleType>
>
> </xsd:element>
>
>  
>
> Note that ENUMTYPE restriction is defined in the qbxmltypes70.xsd
> included by qbxml70.xsd on line 17.  qbxmltypes70.xsd defines
ENUMTYPE as

>
>  
>
> <xsd:simpleType name="ENUMTYPE">
>
>   <xsd:restriction base="xsd:string">
>
>   </xsd:restriction>
>
> </xsd:simpleType>
>
>  
>
> I will happily forward the entire XSDs if needed, but they are
a bit
> large.
>
>  
>
> Unfortunately, as these XSDs are defined by Intuit, I cannot
change them.
>
>  
>
> I have had significant previous positive experience with JiBX,
so this
> comes somewhat as a surprise to me.  Therefore, only as a data
point
> to rule out structural problems with the QuickBooks schemas; I
offer
> that the same xsds complete without errors when using
XML-BEANS.  I
> would, of course, prefer to stick with JIBX if this can be
resolved or
> worked around, however, this is presently a show stopper for us.
>
> Any and all help will be greatly appreciated!
>
> Thanks in advance for your help!
>
> Todd
>
>
------------------------------------------------------------------------
>
>
------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in
SF, CA
> is the only developer event you need to attend this year.
Jumpstart your
> developing skills, take BlackBerry mobile applications to
market and stay
> ahead of the curve. Join us from November 9 - 12, 2009.
Register now!
> http://p.sf.net/sfu/devconference
>
------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@...
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>  

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year.
Jumpstart your
developing skills, take BlackBerry mobile applications to market
and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users

Namespace binding question

by Harp, George-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have the following xml:
<wml:MLWeather NAVTEQVersion="1.1.0" serialNumber="1251825849597"
feedCreation="2009-10-26T15:51:04.662Z">
   <observation long="-87.75" lat="41.78" location="Chicago Midway
Airport" city="Chicago" sourceID="KMDW">
      <dataItem sourceCreation="2009-10-26T15:42:07.000Z"
name="current">
         <item value="1018.60" name="barometer"/>
         <item value="R" name="barometerTrend"/>
         <item value="18" name="cloudCode"/>
         <item value="Overcast" name="cloudCover"/>
         <item value="Overcast. Cool." name="description"/>
         <item value="7.78" name="dewPoint"/>
         <item value="9.79" name="feelsLike"/>
         <item value="80" name="humidity"/>
         <item value="" name="precip"/>
         <item value="11.11" name="tempCurrent"/>
         <item value="16.09" name="visibility"/>
         <item value="180" name="windDirection"/>
         <item value="11.12" name="windSpeed"/>
      </dataItem>
   </observation>
</wml:MLWeather>

My binding file:
<binding>
   <mapping name="MLWeather"
            class="com.traffic.hdradio.b2b.weather.MLWeather">


      <value name="NAVTEQVersion"
             field="navteqVersion"
             usage="optional"/>
      <value name="serialNumber"
             field="serialNumber"
             usage="optional"/>
      <value name="feedCreation"
             field="feedCreation"
             usage="optional"/>

      <structure field="observation"
                 usage="optional"/>

   </mapping>
...

My question is what namespace binding can I add to parse the above with
th "wml" namespace?
<namespace uri="http://www.navteq.com/schemas/"
           default="all"
           prefix="wml"/>

If I add the namespace snippet I get invalid xml at line 1 column 1.

Also, Is the above standard xml? Valid?




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users

Re: Namespace binding question

by Nigel Charman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The XML is missing a namespace declaration for the wml prefix. Try
changing the first line to:

<wml:MLWeather xmlns:wml="http://www.navteq.com/schemas/" NAVTEQVersion="1.1.0" serialNumber="1251825849597"
feedCreation="2009-10-26T15:51:04.662Z">

regards.
nigel.

Harp, George wrote:

> I have the following xml:
> <wml:MLWeather NAVTEQVersion="1.1.0" serialNumber="1251825849597"
> feedCreation="2009-10-26T15:51:04.662Z">
>    <observation long="-87.75" lat="41.78" location="Chicago Midway
> Airport" city="Chicago" sourceID="KMDW">
>       <dataItem sourceCreation="2009-10-26T15:42:07.000Z"
> name="current">
>          <item value="1018.60" name="barometer"/>
>          <item value="R" name="barometerTrend"/>
>          <item value="18" name="cloudCode"/>
>          <item value="Overcast" name="cloudCover"/>
>          <item value="Overcast. Cool." name="description"/>
>          <item value="7.78" name="dewPoint"/>
>          <item value="9.79" name="feelsLike"/>
>          <item value="80" name="humidity"/>
>          <item value="" name="precip"/>
>          <item value="11.11" name="tempCurrent"/>
>          <item value="16.09" name="visibility"/>
>          <item value="180" name="windDirection"/>
>          <item value="11.12" name="windSpeed"/>
>       </dataItem>
>    </observation>
> </wml:MLWeather>
>
> My binding file:
> <binding>
>    <mapping name="MLWeather"
>             class="com.traffic.hdradio.b2b.weather.MLWeather">
>
>
>       <value name="NAVTEQVersion"
>              field="navteqVersion"
>              usage="optional"/>
>       <value name="serialNumber"
>              field="serialNumber"
>              usage="optional"/>
>       <value name="feedCreation"
>              field="feedCreation"
>              usage="optional"/>
>
>       <structure field="observation"
>                  usage="optional"/>
>
>    </mapping>
> ...
>
> My question is what namespace binding can I add to parse the above with
> th "wml" namespace?
> <namespace uri="http://www.navteq.com/schemas/"
>            default="all"
>            prefix="wml"/>
>
> If I add the namespace snippet I get invalid xml at line 1 column 1.
>
> Also, Is the above standard xml? Valid?
>
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> jibx-users mailing list
> jibx-users@...
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>  

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users