| Author | 
		  Message
		 | 
		
		  | shalini123 | 
		  
		    
			  
				 Posted: Thu Jan 08, 2004 6:05 am    Post subject: XML tag | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 03 Dec 2003 Posts: 34
  
  | 
		  
		    
			  
				My msg flow is as foll: 
 
input-rcd-map-computeoutput
 
 
my map node does the mapping between my i/p and o/p msg sets. in my compute node i want to manipulate 1 tag.
 
 
This is my code in my compute node
 
 
I want to add the value No to the foll o/p XML 
 
 
<tag1>
 
<tag2>
 
 
---
 
\--
 
</tag2>
 
</tag1>
 
SET OutputRoot = InputRoot;
 
DECLARE respTag REFERENCE TO OutputRoot.XML.Tag1.Tag2;
 
		
 
CREATE FIRSTCHILD OF respTag NAME 'Resp' VALUE 'No'; | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Thu Jan 08, 2004 9:47 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				Well it depends where in the tree you want the new tag.  How about just:
 
 
   
	| Code: | 
   
  
	SET OutputRoot = InputRoot;
 
SET OutputRoot.XML.Tag1.Tag2.Resp = 'No';
 
 | 
   
 
 
 
Cheers, _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | shalini123 | 
		  
		    
			  
				 Posted: Thu Jan 08, 2004 10:53 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 03 Dec 2003 Posts: 34
  
  | 
		  
		    
			  
				I want this to be a new tag after my first tag. Hence firstchild. but this is not working.
 
 
In case I do what yopu suggested: its forming the XML tag again and not in the location i want. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | seeknee | 
		  
		    
			  
				 Posted: Fri Jan 09, 2004 3:07 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 08 Aug 2002 Posts: 41 Location: Melbourne, Australia 
  | 
		  
		    
			  
				If the tag is in the wrong position you could try this code
 
 
DECLARE myref REFERENCE TO OutputRoot.XML.Tag1.Tag2.Resp ;
 
DETACH myref;
 
ATTACH myref TO OutputRoot.XML.TPCIData AS FIRSTCHILD;
 
 
Hopefully this will help
 
   | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | shalini123 | 
		  
		    
			  
				 Posted: Fri Jan 09, 2004 4:08 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 03 Dec 2003 Posts: 34
  
  | 
		  
		    
			  
				No, my req is as foll:
 
 
My XML out of my map node is as follows.
 
 
<name>
 
<a></a>
 
<b>
 
    <c></c>
 
</b>
 
</name>
 
 
I need to do some manipuilation in my compute node and insert a new tag at location a .
 
 
I tried using the foll: ESQL
 
 
SET OutputRoot = InputRoot;
 
		
 
DECLARE myref REFERENCE TO OutputRoot.XML.Name.a;
 
CREATE FIRSTCHILD OF myref NAME 'Message1' VALUE 'Hello'; 
 
 
But its not working. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Fri Jan 09, 2004 9:18 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	<name> 
 
<a></a> 
 
<b> 
 
<c></c> 
 
</b> 
 
</name> 
 
 | 
   
 
Which of these are from the input and which is the one you are trying to add.  Please post a sample of the input and also the expected output so we can see exactly what you are trying to achieve.
 
 
Cheers, _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | shalini123 | 
		  
		    
			  
				 Posted: Sat Jan 10, 2004 1:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 03 Dec 2003 Posts: 34
  
  | 
		  
		    
			  
				This is being formed from the input XML 
 
<name> 
 
<a></a> 
 
<b> 
 
<c></c> 
 
</b> 
 
</name> 
 
 
 
and i need to add a new tag | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Sat Jan 10, 2004 10:12 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| Please post a sample of the input and also the expected output  | 
   
 
 
 
Without that we don't know what tag you want, and where in the tree you want it.
 
 
Cheers, _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Missam | 
		  
		    
			  
				 Posted: Mon Jan 12, 2004 9:39 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Chevalier
 
 Joined: 16 Oct 2003 Posts: 424
  
  | 
		  
		    
			  
				Hi,
 
  It looks like you are using pre-defined XML as both your input and output messages. you are saying that your map node takes care of mapping both i/p and o/p messages.do you really want to manipulate a tag or create a new one as your first child of the existing message.
 
your requirement is a bit confusing.can you explain more clearly
 
Thanx
 
sam | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |