Actually, have a look at the following mapping for a very simple Entity
class:
<?xml version="1.0" ?>
<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
"http://castor.org/mapping.dtd">
<mapping>
<class name="xml.reinhard.Entity" xmlns:r="http://test">
<map-to xml="entity" ns-prefix="r" ns-uri="http://test"/>
<field name="id" type="integer" >
<bind-xml name="id" />
</field>
<field name="name" type="string">
<bind-xml name="name" />
</field>
<field name="att" type="string">
<bind-xml name="r:att" node="attribute" />
</field>
</class>
</mapping>
This works out of the box. Please *note* that removing the xmlns:r
namespace declaration will cause a failure when unmarshalling the
mapping file.
I hope this helps.
Werner
Werner Guttmann wrote:
> Reinhard,
>
> please read inline.
>
> Reinhard Weiss wrote:
>> hi,
>>
>> is there a way to force qualification of attributes in the marshalled
>> xml output (e.g. in case the schema defines
>> attributeFormDefault="qualified")?
> If you happen to have an XML schema at hands (and you last comment seems
> to indicate this), why don't you generate domain classes and descriptor
> classes from the XML schema, and things will be taken care of
> automatically ?
>
>> qualification of elements can easily be done via the <map-to>
>> element. but i have not found a way to define namespaces for
>> attributes.
> Can I assume that you are using a mapping file ?
>> eg using the 'QName-prefix' in the <bind-xml> does not
>> seem to have much effect.
> Have you tried to use a <bind-xml> element such as
>
> <bind-xml name="a:attribute" />
>
> I know this might not feel right, but let's try to narrow this down
> first ? If you had a *minimal * test case, please feel free to make it
> available ? The less time I spend on setting things up, the more I cam
> e.g. debug source code to see what's going wrong (in case this is a bug)
> or what's missing configuration-wise.
>
>> thx,
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>> DI Reinhard Weiss Java Developer
>>
>> ANECON Software Design und Beratung G.m.b.H. Alser Straße 4 / Hof 1
>> A-1090 WIEN
>>
>> Tel.: +43 1 409 58 90-0 Fax: +43 1 409 58 90-998 Web:
>> http://www.anecon.com
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>> Zusätzliche Pflichtangaben von Kapitalgesellschaften gem. § 14 UGB:
>> FN166941b | Handelsgericht Wien | Firmensitz Wien
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email