|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| How to creating generic CSV with repeating elements | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | pcelari | 
			  
				|  Posted: Fri Jul 17, 2009 6:46 am    Post subject: How to creating generic CSV with repeating elements |   |  |  
		  | Chevalier
 
 
 Joined: 31 Mar 2006Posts: 411
 Location: New York
 
 | 
			  
				| Hi, 
 I'm trying to create a msgset that defines a generic CVS with unknown number of repeats. specifically, I want to model a message that can accommodate the following syntax:
 
 ServiceName,parm1,parm2,parm3,...,parmN, with N unknown, only ServiceName is manditory.
 
 So I defined a msg GenCSV with two elelemts,
 
 ServiceName occurance 1, 1
 
 Parms - a complex element containing element parm.
 
 I set parm's occurance to 0, -1. However, based on documentation, "repeating element delimiter" cannot be the same as "Delimiter".
 
 Of course, I can avoid setting the "Delimiter" at messageset level and remove the first element "ServiceName", and use the first element of Parms as ServiceName, and set parm's occurance to 1,-1 and use ',' as repeating element delimiter. But this is not as straightforward for developers.
 
 So here the question: is there a way to get around of the above limitation?
 
 
  _________________
 pcelari
 -----------------------------------------
 - a master of always being a newbie
 |  |  
		  | Back to top |  |  
		  |  |  
		  | kimbert | 
			  
				|  Posted: Sun Jul 19, 2009 2:20 pm    Post subject: |   |  |  
		  |  Jedi Council
 
 
 Joined: 29 Jul 2003Posts: 5543
 Location: Southampton
 
 | 
			  
				| Put the repeating element inside its own group? |  |  
		  | Back to top |  |  
		  |  |  
		  | pcelari | 
			  
				|  Posted: Mon Jul 20, 2009 4:10 am    Post subject: |   |  |  
		  | Chevalier
 
 
 Joined: 31 Mar 2006Posts: 411
 Location: New York
 
 | 
			  
				| Hi kimbert, thanks for stepping in. Now I know an answer is available. 
 
 
   
	| kimbert wrote: |  
	| Put the repeating element inside its own group? |  
 Are you saying I can use the same delimiter ',' for data element separation and repeating element separation? Or do you mean, I put them all under a single parent element?
 
 - I got it. You mean using a single parent element, containing a first element SvcName with (1,1) occurence, and second element with (0,-1) occurence. This way there should be no confusion for the parser.
 
 But then, why not doing the same at the root level? Will try it out now.
 _________________
 pcelari
 -----------------------------------------
 - a master of always being a newbie
 |  |  
		  | Back to top |  |  
		  |  |  
		  | kimbert | 
			  
				|  Posted: Tue Jul 21, 2009 1:29 pm    Post subject: |   |  |  
		  |  Jedi Council
 
 
 Joined: 29 Jul 2003Posts: 5543
 Location: Southampton
 
 | 
			  
				| I was suggesting a model like this 
   
	| Code: |  
	| Element name="message"
 complexType DataElementSeparation="All Elements Delimited" Delimiter="<cr>"
 element name="line"
 complexType DataElementSeparation="All Elements Delimited" Delimiter=","
 element name="ServiceName" ...
 group DataElementSeparation="All ElementsDelimited" Delimiter="anythingYouLike"
 element name="parameter" maxOccurs="-1" RepeatingElementDelimiter=","
 
 |  |  |  
		  | Back to top |  |  
		  |  |  
		  |  |  |  
  
	|    |  | Page 1 of 1 |  
 
 
  
  	| 
		
		  | 
 
 | You cannot post new topics in this forum You cannot reply to topics in this forum
 You cannot edit your posts in this forum
 You cannot delete your posts in this forum
 You cannot vote in polls in this forum
 
 |  |  |  |