What is the binding definition for a top level element containing the value?

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

What is the binding definition for a top level element containing the value?

by VanIngen, Erik (FIES) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What is the binding definition for a top level element containing the value?

Hi mailinglist!

What is the binding definition for a top level element containing the value?

This is the xml which I would like to marshall/unmarshall:
<?xml version="1.0" encoding="UTF-8"?>
<fact:Get3AlphaCodeRequest xmlns:fact="http://www.fao.org/fi/domain/flattener">fakeValue</fact:Get3AlphaCodeRequest>


This is my failing attempt for a binding definition:
<?xml version="1.0" encoding="UTF-8"?>
<binding>
        <namespace uri="http://www.fao.org/fi/domain/flattener" prefix="fact" default="elements" />
        <mapping class="org.fao.figis.flattener.domain.service.Get3AlphaCodeRequest" style="element"
                name="Get3AlphaCodeRequest" field="speciesID">
        </mapping>
</binding>



------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/jibx-users

Parent Message unknown Re: What is the binding definition for a top level element containing the value?

by VanIngen, Erik (FIES) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Message
In the end I have found a solution/workaround. I have changed in the xsd the element into an attribute. This is the mapping
 
 
 

<mapping class="org.fao.figis.flattener.domain.service.core.SpeciesID" type-name="SpeciesID" abstract="true">

      <value style="attribute" name="speciesID" field="speciesID" />

</mapping>

 

<mapping class="org.fao.figis.flattener.domain.service.Get3AlphaCodeRequest" name="Get3AlphaCodeRequest"> 

       <structure map-as="SpeciesID" />

</mapping>

 
 
 -----Original Message-----
From: VanIngen, Erik (FIES)
Sent: 04 November 2009 11:26
To: jibx-users@...
Subject: [jibx-users] What is the binding definition for a top level element containing the value?

Hi mailinglist!

What is the binding definition for a top level element containing the value?

This is the xml which I would like to marshall/unmarshall:
<?xml version="1.0" encoding="UTF-8"?>
<fact:Get3AlphaCodeRequest xmlns:fact="http://www.fao.org/fi/domain/flattener">fakeValue</fact:Get3AlphaCodeRequest>


This is my failing attempt for a binding definition:
<?xml version="1.0" encoding="UTF-8"?>
<binding>
        <namespace uri="http://www.fao.org/fi/domain/flattener" prefix="fact" default="elements" />
        <mapping class="org.fao.figis.flattener.domain.service.Get3AlphaCodeRequest" style="element"
                name="Get3AlphaCodeRequest" field="speciesID">
        </mapping>
</binding>



------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/jibx-users

Re: What is the binding definition for a top level element containing the value?

by DSosnoski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Erik,

The <mapping> element in a binding definition applies to a class as a
whole, so you can't use a field="..." attribute directly on this
element. You'd instead need to use this type of binding:

<binding>
        <namespace uri="http://www.fao.org/fi/domain/flattener"
prefix="fact" default="elements" />
        <mapping
class="org.fao.figis.flattener.domain.service.Get3AlphaCodeRequest"
name="Get3AlphaCodeRequest">
              <value field="speciesID" style="text"/>
        </mapping>
</binding>

  - Dennis

Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



VanIngen, Erik (FIES) wrote:

>
> Hi mailinglist!
>
> What is the binding definition for a top level element containing the
> value?
>
> This is the* xml* which I would like to marshall/unmarshall:
> <?xml version=/"1.0"/ encoding=/"UTF-8"/?>
> <fact:Get3AlphaCodeRequest
> xmlns:fact=/"http://www.fao.org/fi/domain/flattener"/>fakeValue</fact:Get3AlphaCodeRequest>
>
>
>
> This is my failing attempt for a* binding definition*:
> <?xml version=/"1.0"/ encoding=/"UTF-8"/?>
> <binding>
>         <namespace uri=/"http://www.fao.org/fi/domain/flattener"/
> prefix=/"fact"/ default=/"elements"/ />
>         <mapping
> class=/"org.fao.figis.flattener.domain.service.Get3AlphaCodeRequest"/
> style=/"element"/
>                 name=/"Get3AlphaCodeRequest"/ field=/"speciesID"/>
>         </mapping>
> </binding>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> 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@...
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>  

------------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/jibx-users