Hi,

I am not sure if this answers your question.
but you can use it this way by inlcuding other binding defintions.
Here is an example.Its quite a lengthy one and my final binding file includes 3-4 of them but for brevity i have pasted only two bindings.
For clarity i have pasted the output xml that i wish to get from this bining so you can see how inclusion actually works.

Hope this helps.

Rgds,
Chetan

------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                header-binding.xml
------------------------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<binding>
        <mapping name="header" class="Header">
                <structure name="conversationId" value-style="attribute">
                        <value name="conversationIdScheme" field="conversationIdScheme"/>
                        <value style="text" field="conversationId"/>
                </structure>
                <structure name="sentBy" value-style="attribute">
                        <value name="messageIdScheme" field="messageIdScheme"/>
                        <value style="text" field="messageId"/>
                </structure>
                <structure name="sentBy" value-style="attribute">
                        <value name="partyIdScheme" field="partyIdScheme"/>
                        <value style="text" field="sentBy"/>
                </structure>        
                <value name="creationTimeStamp" field="creationTimeStamp"/>
        </mapping>        
</binding>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                        price-binding.xml
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<binding>
        <mapping name="unitPrice" class="UnitPrice">
                <namespace uri="http:chetan.org" prefix="ibml" default="elements"/>
                <value name="currency" field="currency"/>
                <value name="amount" field="amount"/>                
        </mapping>
</binding>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                        CREATE_TRADE BINDING(this inludes the above two bindings)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<binding>
        <include path="header-binding.xml"/>
        <include path="price-binding.xml"/>
        <include path="relativeDate-binding.xml"/>
        <include path="equity-binding.xml"/>
        <include path="equityContract-binding.xml"/>              
                <mapping name="FpML" class="FPML">
                        <value style="attribute" name="xmlns" field="xmlns"/>
                        <value style="attribute" name="ibml" field="ibml"/>
                        <value style="attribute" name="xsi" field="xsi"/>
                        <value style="attribute" name="schemaLocation" field="schemaLocation"/>
                        <value style="attribute" name="type" field="type"/>
                        <value style="attribute" name="version" field="version"/>
                        <value style="attribute" name="ibmlVersion" field="ibmlVersion"/>                        
                        <structure field="header"/>
                        <structure name="trade">
                                <structure name="tradeHeader">
                                        <structure name="partyTradeIdentifier">
                                                <structure  name="partyReference" value-style="attribute">
                                                        <value style="attribute" name="href" field="href"/>                                                        
                                                </structure>
                                                <structure name="tradeId" value-style="attribute">
                                                        <value style="attribute" name="tradeId" field="tradeIdScheme"/>
                                                        <value style="text" field="tradeId"/>
                                                </structure>                                                
                                        </structure> <!-- end of partyTradeIdentifier -->
                                        <structure name="tradeDate" value-style="attribute">
                                                <value name="id" style="attribute" field="tradeDateId"/>
                                                <value style="text" field="tradeDate"/>
                                        </structure>
                                </structure> <!-- tradeHeader structure ends here -->
                                <structure field="equityContract"/>
                        </structure>
                </mapping>                
  <!--  Have removed a block from here -->
</binding>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                        The output xml file achieved with the above bindings
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<FpML xmlns="http://www.fpml.org/2005/FpML-4-2"
        xmlns:ibml="http://ibml/2005"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://ibml/2005 ../../xsd/IBML-1-2-2.xsd"
        xsi:type="ibml:CreateTradeRequest"
        version="4-2"
        ibmlVersion="1-1">
       
        <header>
                <conversationId
                        conversationIdScheme="http://www.jpmorgan.com/coding-scheme/conversationId">EquityShare987</conversationId>
                <messageId
                        messageIdScheme="http://www.jpmorgan.com/coding-scheme/messageId">EquityShare456a789b</messageId>
                <sentBy
                        partyIdScheme="http://www.jpmorgan.com/coding-scheme/partyId">msdw</sentBy>
                <creationTimestamp>2000-08-01T08:57:00-00:00</creationTimestamp>
        </header>
       
        <trade>
                <tradeHeader>
                        <partyTradeIdentifier>
                                <partyReference href="">
                                <tradeId
                                        tradeIdScheme="http://www.PartyA.com/coding-scheme/tradeId">1234</tradeId>
                        </partyTradeIdentifier>
                        <tradeDate id="TradeDate">2005-07-13</tradeDate>
                </tradeHeader>
                <ibml:equityContract>
                        <productType
                                productTypeScheme="http://ibml.jpmorgan.com/coding-scheme/product-type">Equity</productType>
                        <buyerPartyReference href="">
                        <sellerPartyReference href="">
                        <ibml:numberOfUnits>10000</ibml:numberOfUnits>
                        <ibml:unitPrice>
                                <currency>USD</currency>
                                <amount>78.20</amount>
                        </ibml:unitPrice>
                        <ibml:settlementDate>                                
                                <relativeDate>
                                        <periodMultiplier>3</periodMultiplier>
                                        <period>D</period>
                                          <dayType>Business</dayType>
                                        <businessDayConvention>NONE</businessDayConvention>
                                        <businessCenters>
                                                        <businessCenter>EUTA</businessCenter>
                                        </businessCenters>
                                        <dateRelativeTo href="">
                                </relativeDate>
                        </ibml:settlementDate>
                        <ibml:settlementCurrency>USD</ibml:settlementCurrency>
                        <ibml:equity>
                                <instrumentId
                                        instrumentIdScheme="http://www.reuters.com/coding-scheme/instrumentid">STM-FP</instrumentId>
                                <description>STMicroelectronics N.V. ordinary shares</description>
                                <exchangeId
                                        exchangeIdScheme="http://www.fpml.org/schemes/4.1/exchangeId">NSE</exchangeId>
                        </ibml:equity>
                </ibml:equityContract>
        </trade>
       
        <ibml:party id="PartyA">
                <partyId>Party A</partyId>
        </ibml:party>
        <ibml:party id="PartyB">
                <partyId>Party B</partyId>
        </ibml:party>
       
</FpML>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Morgan Rachell <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

14/09/2006 23:02

Please respond to
JiBX users <jibx-users@lists.sourceforge.net>

To
jibx-users@lists.sourceforge.net
cc
Subject
[jibx-users] Wrapping XML with a different element






Sorry if this got posted twice, the first one bounced back to me.

Anyone know how to do this? I want to wrap the output XML in another element
that doesn't map to any class. My mapping looks like this:

<binding forwards="false" value-style="attribute">
<mapping class="com.abc.Shipment" name="shipment">
  <value .../>
  ...
</mapping>

But I want to do something like

<binding forwards="false" value-style="attribute">
<mapping name="form">
  <value style="attribute" name="id" constant="shipmentFormId123"/>
</mapping>
<mapping class="com.abc.Shipment" name="shipment">
  <value ... />
  ...
</mapping>

So the output XML goes from this:

<shipment>
...
</shipment>

to this:

<form id="shipmentFormId123">
  <shipment>
  ...
  </shipment>
</form>

Any thoughts on how I would do this? Thanks!
Morgan

--
View this message in context: http://www.nabble.com/Wrapping-XML-with-a-different-element-tf2274427.html#a6315703
Sent from the jibx-users forum at Nabble.com.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users




This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to