pushExtensionNamespaces() to add the namespace URI to the list we're working with
startTagNamespaces() to write the element start tag and namespace definition (the index will always be the same as the count returned by getNamespaces())
closeStartTag()
writeTextContent()
endTag()
popExtensionNamespaces()
Kind of complicated, but your requirements are pretty specific. Note that you can just reference the marshaller/unmarshaller class in the actual mapping for that element, along these lines:
<structure field="_clientTypeDetail" marshaller="implementation class name here" unmarshaller="implementation class name here"/>
I may try to get an easier method for beta 4, but at least this should work for now. How do you handle this with Castor?
- Dennis
Arild Nilsen wrote:
Hi
Almost done adopting a XML based protocol binding from Castor to Jibx, but one obstacle still pending:
have the following style XML (fragment)
<PresenceSubList xmlns="http://www.openmobilealliance.org/DTD/WV-PA1.2">
<ClientInfo>
<Qualifier>T</Qualifier>
<ClientType>MOBILE_PHONE</ClientType>
<DevManufacturer>ABC Company</DevManufacturer>
<Model>xyz200</Model>
<Language>fin</Language>
<ClientTypeDetail xmlns="http://imps.colibria.com/PA-ext-1.2">jala</ClientTypeDetail>
</ClientInfo>
</PresenceSubList>
the class is something like this
class ClientInfo { /* simplified class */ String _qualifier; String _clientType; String _devManufacturer; String _model; String _language; String _clientTypeDetail; }
The following mapping file (fragment shown here) works:
<mapping name="ClientInfo" class="com.colibria.ccc.protocol12.pa.ClientInfo">
<namespace uri="http://www.openmobilealliance.org/DTD/WV-PA1.2" default="elements"/>
<namespace uri="http://imps.colibria.com/PA-ext-1.2" default="none" prefix="pe" />
<value field="_qualifier" name="Qualifier" usage="optional"/>
<value field="_clientType" name="ClientType" usage="optional"/>
<value field="_devManufacturer" name="DevManufacturer" usage="optional"/>
<value field="_clientProducer" name="ClientProducer" usage="optional"/>
<value field="_model" name="Model" usage="optional"/>
<value field="_clientVersion" name="ClientVersion" usage="optional"/>
<value field="_language" name="Language" usage="optional"/>
<value field="_clientTypeDetail" name="ClientTypeDetail" ns="http://imps.colibria.com/PA-ext-1.2"/>
</mapping>
and gives
<PresenceSubList xmlns="http://www.openmobilealliance.org/DTD/WV-PA1.2"> <ClientInfo xmlns:pe="http://imps.colibria.com/PA-ext-1.2"> <Qualifier>T</Qualifier> <ClientType>MOBILE_PHONE</ClientType> <DevManufacturer>ABC Company</DevManufacturer> <Model>xyz200</Model> <Language>fin</Language> <pe:ClientTypeDetail>jala</pe:ClientTypeDetail> </ClientInfo> </PresenceSubList>
however, I need the format from the input to be preserved. I have played around with all thinkable variations, but no success so far.
Can anybody give me a hint how the achieve this?
// Arild
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users
