You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Narahari Lakshminarayana <nl...@asg.bellsouth.net> on 2005/04/05 19:50:01 UTC

element name substutution.....

Hello,
 
The following question might have been asked before.  I could not find
the
answer thru the search of mailing list.  Here it is.
 
I have a Java POJO that accept XML of the following format
 
<asg:ACTLIST xmlns:asg="http://asg.bellsouth.net">
        <asg:ACT>
                <asg:LEGAL_ACCOUNT_ID>Hello</asg:LEGAL_ACCOUNT_ID>
                <asg:PPP_USER_ID>Ganesha</asg:PPP_USER_ID>
                <asg:EMAIL_ADDRESS>a@b.com</asg:EMAIL_ADDRESS>
                <asg:ACCOUNT_ID>Wow</asg:ACCOUNT_ID>
                <asg:ALIASES_ID>Hi</asg:ALIASES_ID>
        </asg:ACT>
</asg:ACTLIST>
 
The back end data base has the same exact data in the following format
 
<asg:ROWSET xmlns:asg="http://asg.bellsouth.net">
        <asg:ROW>
                <asg:LEGAL_ACCOUNT_ID>Hello</asg:LEGAL_ACCOUNT_ID>
                <asg:PPP_USER_ID>Ganesha</asg:PPP_USER_ID>
                <asg:EMAIL_ADDRESS>a@b.com</asg:EMAIL_ADDRESS>
                <asg:ACCOUNT_ID>Wow</asg:ACCOUNT_ID>
                <asg:ALIASES_ID>Hi</asg:ALIASES_ID>
        </asg:ROW>
</asg:ROWSET>
 
If you look at it carefully the only diff is the ELEMENT names for
ROWSET
and ROW are different.
 
THE SCHEMA FOR BOTH IS THE SAME THOUGH.
 
Is there any way to tell XMLBeans when it loads the XML string, that
treat
both ROWSET element and ACTLIST as the same and populate the classes ?
 
On the output side also, can I tell XMLBeans to output ACTLIST instead
of
ROWSET which it does currently today ?
 
-Narahari

Re: element name substutution.....

Posted by Rashmi Banthia <rj...@gmail.com>.
Does your XSD have substitution groups ? XMLBeans can handle
substitiution Groups.
Hope this helps! 

Regards,
Rashmi

On Apr 5, 2005 1:50 PM, Narahari Lakshminarayana
<nl...@asg.bellsouth.net> wrote:
>  
> Hello, 
>   
> The following question might have been asked before.  I could not find the
> answer thru the search of mailing list.  Here it is. 
>   
> I have a Java POJO that accept XML of the following format 
>   
> <asg:ACTLIST xmlns:asg="http://asg.bellsouth.net">
>         <asg:ACT>
>                
> <asg:LEGAL_ACCOUNT_ID>Hello</asg:LEGAL_ACCOUNT_ID>
>                 <asg:PPP_USER_ID>Ganesha</asg:PPP_USER_ID>
>                 <asg:EMAIL_ADDRESS>a@b.com</asg:EMAIL_ADDRESS>
>                 <asg:ACCOUNT_ID>Wow</asg:ACCOUNT_ID>
>                 <asg:ALIASES_ID>Hi</asg:ALIASES_ID>
>         </asg:ACT>
> </asg:ACTLIST> 
>   
> The back end data base has the same exact data in the following format 
>   
> <asg:ROWSET xmlns:asg="http://asg.bellsouth.net">
>         <asg:ROW>
>                
> <asg:LEGAL_ACCOUNT_ID>Hello</asg:LEGAL_ACCOUNT_ID>
>                 <asg:PPP_USER_ID>Ganesha</asg:PPP_USER_ID>
>                 <asg:EMAIL_ADDRESS>a@b.com</asg:EMAIL_ADDRESS>
>                 <asg:ACCOUNT_ID>Wow</asg:ACCOUNT_ID>
>                 <asg:ALIASES_ID>Hi</asg:ALIASES_ID>
>         </asg:ROW>
> </asg:ROWSET> 
>   
> If you look at it carefully the only diff is the ELEMENT names for ROWSET
> and ROW are different. 
>   
> THE SCHEMA FOR BOTH IS THE SAME THOUGH. 
>   
> Is there any way to tell XMLBeans when it loads the XML string, that treat
> both ROWSET element and ACTLIST as the same and populate the classes ? 
>   
> On the output side also, can I tell XMLBeans to output ACTLIST instead of
> ROWSET which it does currently today ? 
>   
> -Narahari

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org