Abstract collection mapping
---------------------------
Key: JIBX-216
URL: http://jira.codehaus.org/browse/JIBX-216
Project: JiBX
Issue Type: Bug
Affects Versions: JiBX 1.1.6
Environment: Maven version: 2.0.8
Java version: 1.5.0_14
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
Reporter: Davy E. Chan
Fix For: JiBX 1.1.6
I keep getting the following error regardless of what I tried:
<org.jibx.runtime.JiBXException: Expected
"{http://www.opentravel.org/OTA/2003/05}POS" end tag, found
"{http://www.opentravel.org/OTA/2003/05}Source" start tag (line 3, col 214, in
UTF-8)>
*Main binding:*
<?xml version="1.0" encoding="UTF-8"?>
<binding name="OTA_HotelAvailNotif"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="binding.xsd">
<include path="OTA_TagAttrs-binding.xml"/>
<include path="includes/OTA_Hotel_POS_Source-ibinding.xml"/>
<mapping name="OTA_HotelAvailNotifRQ"
class="com.j2mix.ota.hotel.AvailNotifRQ" extends="com.j2mix.ota.OtaTagAttrs">
<namespace prefix="xsi"
uri="http://www.w3.org/2001/XMLSchema-instance" default="none"/>
<namespace uri="http://www.opentravel.org/OTA/2003/05"
default="elements"/>
<!-- extends from Base Class -->
<structure map-as="com.j2mix.ota.OtaTagAttrs"/>
<structure usage="optional" name="POS"
map-as="com.j2mix.ota.POS" set-method="setPos" get-method="getPos"/>
<structure usage="optional" name="UniqueID"/>
<structure usage="optional" name="AvailStatusMessages"/>
<!-- RESPONSE -->
<structure usage="optional" name="Success"/>
<structure usage="optional" name="Warnings"/>
<structure usage="optional" name="Errors"/>
<structure usage="optional" name="TPA_Extentions"/>
</mapping>
</binding>
*Abstract Mapping for POS:*
<binding>
<mapping abstract="true" value-style="attribute" class="com.j2mix.ota.POS">
<value usage="optional" style="text" set-method="setText"
get-method="getText"/>
<collection usage="optional" set-method="setSources"
get-method="getSources"
factory="com.j2mix.ota.POS.sourcesCollectionFactory">
<structure usage="optional" name="Source"
value-style="attribute" type="com.j2mix.ota.common.type.SourceType">
<value usage="optional" name="AgentSine"
set-method="setAgentSine" get-method="getAgentSine"/>
<structure usage="optional" name="RequestorID"
value-style="attribute"
type="com.j2mix.ota.common.RequestorId"
set-method="setRequestorId"
get-method="getRequestorId">
<value usage="optional" name="Type"
set-method="setType" get-method="getType"/>
<value usage="optional" name="URL"
set-method="setUrl" get-method="getUrl"/>
<structure usage="optional"
name="CompanyName" value-style="attribute"
type="com.j2mix.ota.common.type.CompanyNameType"
set-method="setCompanyName"
get-method="getCompanyName">
<value usage="optional"
name="CodeContext" set-method="setCodeContext" get-method="getCodeContext" />
<value usage="optional"
style="text" set-method="setText" get-method="getText"/>
</structure>
</structure>
<structure usage="optional" name="Position"/>
<structure usage="optional"
name="BookingChannel">
<structure usage="optional"
name="CompanyName"/>
</structure>
</structure>
</collection>
</mapping>
</binding>
*Test Xml Files:*
{color:blue}*File OTA_HOTELAVAILNOTIFRQ7.XML*{color}
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2005 rel. 3 U
(http://www.altova.com)-->
<OTA_HotelAvailNotifRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.opentravel.org/OTA/2003/05"
xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05
OTA_HotelAvailNotifRQ.xsd" EchoToken="AvailNotifRQ7"
TimeStamp="2004-05-01T06:39:09" Target="Production" Version="1.002">
<POS><!--
<Source AirportCode="AAA" ISOCountry="aa"
FirstDepartPoint="Str" AirlineVendorID="AA" AgentSine="String"
PseudoCityCode="String" ERSP_UserID="String" TerminalID="String"
ISOCurrency="aaa" AgentDutyCode="String">
<RequestorID Type="0.AAA.X" URL="http://www.altova.com"
Instance="String" ID="String" ID_Context="String" MessagePassword="String">
<CompanyName CodeContext="String"
CompanyShortName="Str" Division="String" Code="String" Department="String"
TravelSector="0.AAA.X">RequestId.CompanyName</CompanyName>
</RequestorID>
<Position Altitude="String" Longitude="String"
Latitude="String" AltitudeUnitOfMeasureCode="0.AAA.X"/>
<BookingChannel Primary="true" Type="0.AAA.X">
<CompanyName CodeContext="String"
CompanyShortName="String" Division="String" Code="String" Department="String"
TravelSector="0.AAA.X">BookingChannel.CompanyName</CompanyName>
</BookingChannel>
</Source> -->
{color:red}Davy is Testing{color}
</POS>
</HotelAvailNotifRQ>
{color:blue}*File OTA_HOTELAVAILNOTIFRQ8.XML*{color}
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2005 rel. 3 U
(http://www.altova.com)-->
<OTA_HotelAvailNotifRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.opentravel.org/OTA/2003/05"
xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05
OTA_HotelAvailNotifRQ.xsd" EchoToken="AvailNotifRQ7"
TimeStamp="2004-05-01T06:39:09" Target="Production" Version="1.002">
<POS>
<Source AgentSine="String">
<RequestorID>
<CompanyName
CodeContext="String">RequestId.CompanyName</CompanyName>
</RequestorID>
<Position Altitude="String" Longitude="String"
Latitude="String" AltitudeUnitOfMeasureCode="0.AAA.X"/>
<BookingChannel Primary="true" Type="0.AAA.X">
<CompanyName
CodeContext="String">BookingChannel.CompanyName</CompanyName>
</BookingChannel>
</Source>
<Source>
<RequestorID>
<CompanyName
CodeContext="String">RequestId.CompanyNameB.A</CompanyName>
</RequestorID>
<Position Altitude="String" Longitude="String"
Latitude="String" AltitudeUnitOfMeasureCode="1.AAA.X"/>
<BookingChannel Primary="true" Type="1.AAA.X">
<CompanyName
CodeContext="String">BookingChannel.CompanyNameB.B</CompanyName>
</BookingChannel>
</Source>
</POS>
</HotelAvailNotifRQ>
*Console Log:*
2008-05-15 09:10:10,343 INFO [com.j2mix.pipeline.sp.jibx.JibxServicePluginTest]
- <Loop =
./SRC/TEST/RESOURCES/OTA/HOTEL/AVAILNOTIF/{color:blue}OTA_HOTELAVAILNOTIFRQ7.XML{color}>
2008-05-15 09:10:10,375 INFO [com.j2mix.pipeline.sp.jibx.JibxServicePluginTest]
- <Result
AvailNotifRQ {OtaAttrs {mEchoToken=AvailNotifRQ7,
mTimeStamp=2004-05-01T06:39:09, mTarget=Production, mVersion=1.002,
mTransactionIdentifier=null, mSequenceNmbr=null, mTransaction
StatusCode=null, mPrimaryLangId=null, mAltLangId=null,
mRetransmissionIndicator=null, mMessageContentCode=null}, mPos=POS {mText=
{color:red}Davy is Testing{color}
mSource=null}, mUniqueId=null, mAvailStatusMessages=null}>
2008-05-15 09:10:10,375 INFO [com.j2mix.pipeline.sp.jibx.JibxServicePluginTest]
- <Loop =
./SRC/TEST/RESOURCES/OTA/HOTEL/AVAILNOTIF/{color:blue}OTA_HOTELAVAILNOTIFRQ8.XML{color}>
2008-05-15 09:10:10,390 INFO [com.j2mix.pipeline.sp.jibx.JibxServicePluginTest]
- <org.jibx.runtime.JiBXException: Expected
"{http://www.opentravel.org/OTA/2003/05}POS" end tag, fo
und "{http://www.opentravel.org/OTA/2003/05}Source" start tag (line 3, col 214,
in UTF-8)>
Here are my questions:
1. According to the tutorial, it does not show abstract mapping for collection.
Does JIBS support it? I hope so from reading past bug comments.
2. If #1 is YES, then can you please show me an example of it? It is
interesting to see that the Text within the <POS> tag is store in the object
reading "Davy is Testing"; however, the later parsing show an error when the
<Source> tag is active.
Appreciate in advance for your prompt response on this one.
Davy
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs