Hi,

I am using JiBX 1.21.1 on Windows XP. Given the following schema

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
    xmlns="http://jibx.org/starter"; targetNamespace="http://jibx.org/starter";>
        <xs:element name="product">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element ref="productName"></xs:element>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>

        <xs:element name="productName" type="xs:string"/>
</xs:schema>

No problem with codegen and binding. But when I unmarshal this XML:

<product xmlns="http://jibx.org/starter";>
    <productName>xyz</productName>
</product>

I received JiBXException:

     [java] Exception in thread "main" org.jibx.runtime.JiBXException: Expected 
"{http://jibx.org/starter}productName"; start tag, found 
"{http://jibx.org/starter}productName"; end tag (line 2, col 35)
     [java]     at 
org.jibx.runtime.impl.UnmarshallingContext.matchStart(UnmarshallingContext.java:652)
     [java]     at 
org.jibx.runtime.impl.UnmarshallingContext.parsePastStartTag(UnmarshallingContext.java:685)
     [java]     at 
org.jibx.runtime.impl.UnmarshallingContext.parseElementText(UnmarshallingContext.java:940)
     [java]     at 
org.jibx.starter.ProductName.JiBX_binding_unmarshal_1_0(Unknown Source)
     [java]     at org.jibx.starter.JiBX_bindingProductName_access.unmarshal()
     [java]     at org.jibx.starter.Product.JiBX_binding_unmarshal_1_0(Unknown 
Source)
     [java]     at org.jibx.starter.JiBX_bindingProduct_access.unmarshal()
     [java]     at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2762)
     [java]     at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2919)

Does anyone know what happened? It is a simple schema and XML is valid.

Thanks in advance.



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to