| Author | 
		  Message
		 | 
		
		  | maxis | 
		  
		    
			  
				 Posted: Wed Mar 26, 2003 7:03 am    Post subject: xml tag value null ? | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 25 Jun 2002 Posts: 144
  
  | 
		  
		    
			  
				hi .. 
 
     I was trying to set the xml element value as NULL 
 
 
If I say OutputRoot.XML.ABC.element = null - then element itself is becoming null ... not the value ...
 
 
     In some pdf .. I had read usage of verb value ..but not able to recollect the exact syntax ... 
 
 
hope to get a quick answer ..
 
thanks
 
M | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Wed Mar 26, 2003 7:13 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				This is in the ESQL reference. 
   
	| Code: | 
   
  
	| Set OutputRoot.XML.ABC.element VALUE = null; | 
   
 
 will create 
   
	| Code: | 
   
  
	| <ABC><element>NULL</element></ABC> | 
   
 
This only works in 2.1, as far as I know, and only in some of the newer CSDs. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | maxis | 
		  
		    
			  
				 Posted: Wed Mar 26, 2003 7:52 am    Post subject: thank you & another question | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 25 Jun 2002 Posts: 144
  
  | 
		  
		    
			  
				thanks for the quick turn around...
 
 
but, have a following question ...     
 
 
How can I check for InputRoot  ?
 
 
if (InputRoot.XML.ABC."Element" value is null ) ....
 
 
is throwing syntax exception ... 
 
 
Am I suppose to use InputRoot.XML.ABC."Element" = '' ?
 
 
Thanks again
 
M | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Wed Mar 26, 2003 8:05 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| if (InputRoot.XML.ABC."Element" value is null ) | 
   
 
The value qualifier only applies in set statements, and is only to indicate that you specifically want to only set the value, and not delete the tag in question. 
 
   
	| Code: | 
   
  
	| If (InputRoot.XML.ABC."Element" is null) | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | yaakovd | 
		  
		    
			  
				 Posted: Wed Mar 26, 2003 8:11 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Partisan
 
 Joined: 20 Jan 2003 Posts: 319 Location: Israel 
  | 
		  
		    
			  
				Actually it depends on what your application expect. I mean if 'null' value for you is empty tag? 
 
 
   
	| Code: | 
   
  
	| OutputRoot.XML.ABC.element = ''  | 
   
 
 
will create message as <ABC><element></element></ABC> _________________ Best regards.
 
              Yaakov
 
SWG, IBM Commerce, Israel | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |