> Usually Castor doesn't add the xmlns="" unless it needs to 
> because there
> is a default namespace set on an ancestor element and the current
> element doesn't belong to that default namespace.
> 
> What does your mapping file look like?
I've tried to use the auto-complete="true" on all other fields than 
the Time field so my mapping file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<mapping>
    <description>
       Creates a mapping to ensure proper formatting of the date fields
    </description>
    <class name="no.nordea.safe.raitnow.ejb.ra.Order" auto-complete="true">
        <map-to xml="Order"/>
        <field 
            name="Time" 
            type="date" 
            handler="no.nordea.safe.raitnow.ejb.BBSDateTimeHandler" 
            required="true"
        >
            <bind-xml name="Time" node="element" />
        </field>
    </class>
</mapping>


The typical resulting XML document should look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<BankIDMessage xmlns="urn:bankid:Bank_RA_Schema">
      <Order>
          <OrderID>6001-orderID</OrderID>
          <Time>2003-11-13T12:45:43</Time>
           .....
      </Order>
</BankIDMessage>

> Is the <Time> element the root element, or is it a child of someother
> element?
So as you probably see the <Time> element is a child element. 

All these elements are generated from a XML Schema with the following 
XML Namespace declaration in the Schema:

<xs:schema targetNamespace="urn:bankid:Bank_RA_Schema" 
       xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
       xmlns="urn:bankid:Bank_RA_Schema" 
       elementFormDefault="qualified" 
       attributeFormDefault="unqualified" 
       version="1.1">
....
</xs:schema>


> The Marshaller#setNoNamespaceSchemaLocation and the
> Marshaller#setSchemaLocation methods do not control namespace output.
> 
> You could try Marshaller#setNamespaceMapping, but that won't 
> get rid of the xmlns="" in most cases.
OK... That's good to know. Do you think that these thinks should be included 
in the JavaDoc for these methods ? If I had an proper overview I could 
probably have written some examples for the resulting XML when utilize these 
methods, but I'm not there yet. 

Thanks for your feedback Keith - it's very appreciated

---- Trond

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to