You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by gd...@free.fr on 2004/08/27 11:44:59 UTC

[betwixt] XML to java question

Hi all,
I want to passe from the following XML

 	<?xml version="1.0" encoding="ISO-8859-1"?>
 	<!DOCTYPE form [ <!ELEMENT field (field*) >
	<!ATTLIST field code ID #REQUIRED>]>
 	<form>
 		<field code="txtNumClient">num1</field>
 		<field code="chkSuiviICP">boolTrue</field>
	</form>

To the following java bean

	public class Form {
		private String txtNumClient;
		private boolean chkSuiviICP;
		// ...
	}

How to use my ID attributes "code" from the XML to map my bean attributes in
Java?
Thank you for any suggestions.

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


Re: [betwixt] XML to java question

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Sat, 2004-08-28 at 22:43, Simon Kitching wrote:
> >  --- gdansk@free.fr 的正文:
> > > Hi all,
> > > I want to passe from the following XML
> > > 
> > >  	<?xml version="1.0" encoding="ISO-8859-1"?>
> > >  	<!DOCTYPE form [ <!ELEMENT field (field*) >
> > > 	<!ATTLIST field code ID #REQUIRED>]>
> > >  	<form>
> > >  		<field code="txtNumClient">num1</field>
> > >  		<field code="chkSuiviICP">boolTrue</field>
> > > 	</form>
> > > 
> > > To the following java bean
> > > 
> > > 	public class Form {
> > > 		private String txtNumClient;
> > > 		private boolean chkSuiviICP;
> > > 		// ...
> > > 	}
> > > 
> > > How to use my ID attributes "code" from the XML to
> > > map my bean attributes in
> > > Java?
> > > Thank you for any suggestions.
> 
> Hi,
> 
> Unfortunately the xml you show above is not easy to parse using
> Digester. See this archived email for details:
> http://www.mail-archive.com/commons-user@jakarta.apache.org/msg07607.html

Oops .. sorry, you asked about Betwixt, not Digester. I'll be interested
to see how/if Betwixt handles this.

Regards,

Simon



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


Re: [betwixt] XML to java question

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
>  --- gdansk@free.fr 的正文:
> > Hi all,
> > I want to passe from the following XML
> > 
> >  	<?xml version="1.0" encoding="ISO-8859-1"?>
> >  	<!DOCTYPE form [ <!ELEMENT field (field*) >
> > 	<!ATTLIST field code ID #REQUIRED>]>
> >  	<form>
> >  		<field code="txtNumClient">num1</field>
> >  		<field code="chkSuiviICP">boolTrue</field>
> > 	</form>
> > 
> > To the following java bean
> > 
> > 	public class Form {
> > 		private String txtNumClient;
> > 		private boolean chkSuiviICP;
> > 		// ...
> > 	}
> > 
> > How to use my ID attributes "code" from the XML to
> > map my bean attributes in
> > Java?
> > Thank you for any suggestions.

Hi,

Unfortunately the xml you show above is not easy to parse using
Digester. See this archived email for details:
http://www.mail-archive.com/commons-user@jakarta.apache.org/msg07607.html

Regards,

Simon


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


Re: [betwixt] XML to java question

Posted by gdansk <gd...@free.fr>.
of course i have all the getters/setters i need in my bean.
could you please explain a little more how can i do it easily with digester?

Gao Di a écrit:

>it can be done with digester,very easy.u should have
>the get method in your bean
>
> --- gdansk@free.fr 的正文:
>  
>
>>Hi all,
>>I want to passe from the following XML
>>
>> 	<?xml version="1.0" encoding="ISO-8859-1"?>
>> 	<!DOCTYPE form [ <!ELEMENT field (field*) >
>>	<!ATTLIST field code ID #REQUIRED>]>
>> 	<form>
>> 		<field code="txtNumClient">num1</field>
>> 		<field code="chkSuiviICP">boolTrue</field>
>>	</form>
>>
>>To the following java bean
>>
>>	public class Form {
>>		private String txtNumClient;
>>		private boolean chkSuiviICP;
>>		// ...
>>	}
>>
>>How to use my ID attributes "code" from the XML to
>>map my bean attributes in
>>Java?
>>Thank you for any suggestions.
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>commons-user-help@jakarta.apache.org
>>
>> 
>>    
>>
>
>_________________________________________________________
>Do You Yahoo!?
>150万曲MP3疯狂搜,带您闯入音乐殿堂
>http://music.yisou.com/
>美女明星应有尽有,搜遍美图、艳图和酷图
>http://image.yisou.com
>1G就是1000兆,雅虎电邮自助扩容!
>http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>  
>





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


Re: [betwixt] XML to java question

Posted by Gao Di <ja...@yahoo.com.cn>.
it can be done with digester,very easy.u should have
the get method in your bean

 --- gdansk@free.fr 的正文:
> Hi all,
> I want to passe from the following XML
> 
>  	<?xml version="1.0" encoding="ISO-8859-1"?>
>  	<!DOCTYPE form [ <!ELEMENT field (field*) >
> 	<!ATTLIST field code ID #REQUIRED>]>
>  	<form>
>  		<field code="txtNumClient">num1</field>
>  		<field code="chkSuiviICP">boolTrue</field>
> 	</form>
> 
> To the following java bean
> 
> 	public class Form {
> 		private String txtNumClient;
> 		private boolean chkSuiviICP;
> 		// ...
> 	}
> 
> How to use my ID attributes "code" from the XML to
> map my bean attributes in
> Java?
> Thank you for any suggestions.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 
>  

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/

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