Alok,

I still have not seen you mapping file, but I'd assume that you have not 
specified ns-uri and ns-prefix attributes on the <map-to> elements of youre 
class mappings, as in 

<class name="somewhere.Something">
   <map-to xml"SomeThing" ns-uri="http://some.uri/"; ns-prefix="some" />

   ...

</class>

Werner

wg> -----Original Message-----
wg> From: Alok Kumar(RPM) [mailto:[EMAIL PROTECTED] 
wg> Sent: Wednesday, December 21, 2005 8:56 AM
wg> To: [email protected]
wg> Subject: RE: [castor-user] Problem setting default namespace
wg> 
wg> I am using mapping file....
wg> 
wg> Let us say I have one class ClassA
wg> 
wg> ClassA{
wg> Private LinkedList lst;
wg> 
wg> getLst(){
wg> return lst;
wg> }
wg> }
wg> 
wg> Now how I define in mapping.xml
wg> 
wg> 
wg>  
wg> 
wg>  
wg> 
wg> This electronic transmission (and any attached documents) 
wg> contains information from Symphony Services and is for the 
wg> sole use of the individual or entity it is addressed to. If 
wg> you receive this message in error, please notify me and 
wg> destroy the attached message (and all attached documents) 
wg> immediately.
wg> 
wg>  
wg> 
wg>  
wg> 
wg> -----Original Message-----
wg> From: Werner Guttmann [mailto:[EMAIL PROTECTED]
wg> Sent: Wednesday, December 21, 2005 1:28 PM
wg> To: [email protected]; [EMAIL PROTECTED]
wg> Subject: RE: [castor-user] Problem setting default namespace
wg> 
wg> Mauricio,
wg> 
wg> Can I assume that you are *not* using a mapping file ? 
wg> 
wg> Werner
wg> 
wg> wg> -----Original Message-----
wg> wg> From: Mauricio De Diana [mailto:[EMAIL PROTECTED]
wg> wg> Sent: Wednesday, December 21, 2005 12:10 AM
wg> wg> To: [email protected]
wg> wg> Subject: [castor-user] Problem setting default namespace
wg> wg> 
wg> wg> Hello.
wg> wg> 
wg> wg> I am new to Castor and I am having some trouble setting 
wg> the default 
wg> wg> namespace when marshalling an object.
wg> wg> 
wg> wg> Code and output follows. I am using Castor-0.9.9.1.
wg> wg> 
wg> wg> Can anyone shed some light on it?
wg> wg> 
wg> wg> Mauricio De Diana
wg> wg> 
wg> wg> Output:
wg> wg> <?xml version="1.0" encoding="UTF-8"?> <person 
wg> wg> xmlns=""><name>NAME</name></person>
wg> wg> 
wg> wg> ------------------------------------
wg> wg> CastorTest.java
wg> wg> public class CastorTest {
wg> wg> 
wg> wg>   public void test() {
wg> wg>     StringWriter sw = new StringWriter();
wg> wg>     try {
wg> wg>       Person p = new Person();
wg> wg>       p.setName("NAME");
wg> wg>       Marshaller marshaller = new Marshaller(sw);
wg> wg>         marshaller.setNamespaceMapping("",
wg> wg> "http://www.test.com.br/X";);
wg> wg>         marshaller.marshal(p);
wg> wg>       } catch (IOException e) {
wg> wg>       } catch (MarshalException e) {
wg> wg>       } catch (ValidationException e) {
wg> wg>       }
wg> wg>       System.out.println(sw.toString());
wg> wg>   }
wg> wg> 
wg> wg>   public static void main(String[] args) {
wg> wg>     new CastorTest().test();
wg> wg>   }
wg> wg> }
wg> wg> 
wg> wg> ------------------------------------------
wg> wg> Person.java
wg> wg> public class Person {
wg> wg>   private String name;
wg> wg>   public String getName() { return name; }
wg> wg>   public void setName(String name) { this.name = name; } }
wg> wg> 
wg> wg> 
wg> wg>         
wg> wg> 
wg> wg> 
wg> wg> 
wg> wg>         
wg> wg>                 
wg> wg> _______________________________________________________
wg> wg> Yahoo! doce lar. Faça do Yahoo! sua homepage. 
wg> wg> http://br.yahoo.com/homepageset.html
wg> wg> 
wg> wg> 
wg> wg> -------------------------------------------------
wg> wg> If you wish to unsubscribe from this list, please send an empty 
wg> wg> message to the following address:
wg> wg> 
wg> wg> [EMAIL PROTECTED]
wg> wg> -------------------------------------------------
wg> wg> 
wg> wg> 
wg> 
wg> -------------------------------------------------
wg> If you wish to unsubscribe from this list, please send an 
wg> empty message to the following address:
wg> 
wg> [EMAIL PROTECTED]
wg> -------------------------------------------------
wg> 
wg> 
wg> -------------------------------------------------
wg> If you wish to unsubscribe from this list, please send an 
wg> empty message to the following address:
wg> 
wg> [EMAIL PROTECTED]
wg> -------------------------------------------------
wg> 
wg> 

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to