Jason-

I'm having a little trouble reproducing the behaviors you're seeing, but there are two things I can think of: one, in your mapping file, are you mapping the two elements <name> to different fields in the java class? (Might be a stupid question, but just want to check) And two, I did have problems back in 0.9.5.4 with having multiple nested elements with the same name (Castor tried to set one of the fields twice and the other one was never touched).

As I dig back in my mail archive, it turns out Keith started working on fixing this problem for multiple namespaces, but differing XPaths was left as a somewhat academic discussion. So I might recommend setting the two <name> elements with different namespaces just as an experiment, and if that works, then maybe you can argue for the change up the line (that's hard though, I know), otherwise, AFAIK Castor can't really handle that mapping -- though if the other person has an XML Schema s/he is working from, perhaps using Castor's SourceGenerator might give you a set of classes that work.

Keith - Do you want to pitch in anything on this topic? I haven't really been tracking progress in Castor XML and "advanced" mappings, so maybe I'm missing something.

Sorry I can't be of more help.

Stephen


Green, Jason M. wrote:
Hey all,
I have been supplied with an xml document that I HAVE to use. There is little chance that I will have the authority to tell the person to modify it. That being said I have hit a wall with the fact that he has nested wrapper elements and inside those are fields with the same name. Is there a way around the error that I get with the mapping file. I get this error: Nested error: org.exolab.castor.mapping.MappingException: The field name appears twice in the descriptor for xml.plan.PlanData

Here is the xml file (at least a portion to explain better):
<MDADocument>
    <defenseDesignDocument>
          <planningContextHeader>
                <world>
                      <worldId />
                     * <name />*
                </world>
            <OPLAN>
                        <planId>-6048061182588210068</planId>
               * <name*>OIF</name>
                 </OPLAN>
          </planningContextHeader>
    </defenseDesignDocument>
</MDADocument>

What I have bolded is where the issue lies. I tried in my mapping file to at least bind to a different name, but that doesn't seem to work.

Any Ideas?
Thanks
Jason



Jason Green
Software Engineer
Northrop Grumman MS
[EMAIL PROTECTED]
(540) 469-2407


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

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

Reply via email to