Unfortunately, this has a bad consequence.  Before, I had a single
"xmlns" attribute in the root element.  After this, I have the
"xmlns:questions" attribute in EVERY element in the entire document.  If
it's going to do that, I'm better off using
"setSuppressNamespaces(true)" (I'm assuming that will just remove my
single "xmlns" attribute, with no other side effects). 

> -----Original Message-----
> From: Werner Guttmann [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, February 24, 2007 9:32 AM
> To: [email protected]
> Subject: Re: [castor-user] How do I control the prefix used 
> for a namespace in the marshalled output?
> 
> David,
> 
> adding the following code to your application after 
> instantiating the Marshaller instance
> 
> marshaller.setNamespaceMapping("questions",
> "http://schemas.wamu.com/2006/07/RiskRating/Questions";);
> 
> should do the trick.
> 
> Regards
> Werner
> 
> Karr, David wrote:
> > In production, I'm currently using v0.9.6, although I'm working on 
> > upgrading to the latest version (as soon as we decide what that will
> > be.)
> > 
> > I have a schema that starts like this:
> > 
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> >  
> > 
> targetNamespace="http://schemas.wamu.com/2006/07/RiskRating/Questions";
> >  
> > 
> xmlns:questions="http://schemas.wamu.com/2006/07/RiskRating/Questions";
> >            elementFormDefault="qualified">
> >   <xs:element name="questionData">
> >     <xs:complexType>
> > 
> > When I marshal my "QuestionData" object to XML, the "questionData"
> > element starts like this:
> > 
> > <questionData
> > xmlns="http://schemas.wamu.com/2006/07/RiskRating/Questions";
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> modelVersion="1"
> > xsi:type="questionData">
> > 
> > How do I make it do this instead:
> > 
> > <questions:questionData
> > 
> xmlns:questions="http://schemas.wamu.com/2006/07/RiskRating/Questions";
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> modelVersion="1"
> > xsi:type="questionData">
> > 
> > I ask this because of some sort of interop issue with a 
> .NET consumer.
> > The XMLSerializer class doesn't grok default namespaces in the SOAP 
> > body child.
> > 
> > 
> ---------------------------------------------------------------------
> > 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

Reply via email to