That should work out-of-the-box. Can you show us a little bit more, i.e.
 what the Java class looks like. Given that your class has a *Descriptor
suffix, could it be the case that this class has been 'generated' from
an XML schema ?

Werner

McCreary, Susan wrote:
> Hi,
> 
> I am new to Castor and am trying to figure out how to include the
> namespace prefix on the root node but suppress the prefix on the child
> nodes.  I've seen some similar postings, but have not found a solution
> yet.
> 
> I am building the object to be marshaled "mnrObject", and then making
> the following calls to set the namespace and marshal the document.
> 
> ...
> File file = new File(fileUrl);
> FileWriter writer = new FileWriter(file);
> Marshaller mar = new Marshaller(writer);
> 
> MaterialNotificationReportDescriptor mnrDesc = new
> MaterialNotificationReportDescriptor();
>        
> mar.setNamespaceMapping("mnr", mnrDesc.getNameSpaceURI());
> mar.marshal(mnrObject);      
> ...
> 
> The following XML is generated.  I want the mnr prefix to appear for the
> first element but not for the child elements (mnr:Lot...).  How can I
> include the "mnr" namespace prefix for the root but not the children?  
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <mnr:MaterialNotificationReport
>  
> xmlns:mnr="http://www.amd.com/schemas/MaterialNotificationReport/MNR_1_1
> _0"
>     Timestamp="2007-06-27T23:05:41.637Z" OrderNo="bol"
>     >
>     <mnr:Lot LotNumber="X71EE00">
>         <mnr:Wafer WaferNum="01"/>
>     </mnr:Lot>
> </mnr:MaterialNotificationReport>
> 
> Thanks in advance for your suggestions.
> 
> Regards,
> 
> Susan
> 
> 
> 
> ---------------------------------------------------------------------
> 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

Reply via email to