I have not tried this but the first thing I am enclined to say is why are you not 
useing dot.notation instead of the $dollar sign "my.package.MyClass.MyInnerClass"?

-----Original Message-----
From: Martin Davidsson [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 2:35 PM
To: [EMAIL PROTECTED]
Subject: [castor-user] [XML] Mapping a static inner class



I am having a problem coming up with the proper mapping for a static  
inner class:

public MyClass {
    // class body
    public static class MyInnerClass { }
}

If, in my mapping file, I say <class  
name="my.package.MyClass$MyInnerClass"> i get

org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal  
XML character is specified.
         at org.apache.xerces.dom.CoreDocumentImpl.createElement(Unknown  
Source)
         at  
org.exolab.castor.xml.util.SAX2DOMHandler.startElement(SAX2DOMHandler.ja 
va:78)

 From my debugging I've become very certain that it's the '$' that is  
the culprit. Castor tries to marshall this class name to  
my-class$-my-inner-class. I've tried using a <map-to  
xml="different-name"/> to get around this without any luck. I've tried  
replacing the '$' with '&#36;' to escape it but that doesn't help  
either. As a last resort I turn to this list. Any ideas? Thank you!

-- Martin



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

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

Reply via email to