| Author | 
		  Message
		 | 
		
		  | fmv0202 | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 10:36 am    Post subject: DTD Declaration and child nodes | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 13 Dec 2006 Posts: 28
  
  | 
		  
		    
			  
				Hello,
 
 
I would like to attach part of a message to a DTD message. The example I have seen is something like this:
 
 
   
	| Code: | 
   
  
	
 
SET OutputRoot.XML.(XML.DocTypeDecl)Create_NC_Customer=''; 
 
SET OutputRoot.XML.(XML.DocTypeDecl).(XML.SystemId) 
 
='Create_NC_Customer_10.dtd'; 
 
SET OutputRoot.XML.(XML.Element)Create_NC_Customer.Test= 'test'; 
 
 | 
   
 
 
 
The problem with this is that I want to somehow assign part of a message body, not a single element. Is there any way to do this? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | elvis_gn | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 10:43 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Padawan
 
 Joined: 08 Oct 2004 Posts: 1905 Location: Dubai 
  | 
		  
		    
			  
				Hi fmv0202,
 
 
So you want to assign part of a message to an output field....you can CAST as char with ccsid....
 
 
How is the DTD declaration related to this issue ?
 
 
Regards. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fmv0202 | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 10:50 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 13 Dec 2006 Posts: 28
  
  | 
		  
		    
			  
				Thanks for the quick response Elvis. Actually, I'm trying to make a message like this:
 
 
   
	| Code: | 
   
  
	
 
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE Request_Message SYSTEM "/QIBM/UserData/DB2Extenders/XML/e-commerce/dtd/RequestMessage.dtd">
 
<Request_Message>
 
.....
 
 
 | 
   
 
 
 
The problem is when I perform the example I've sited, I lose all the
 
data underneath the Request_Message tag. 
 
 
In other words, I hav ethe Request_Message content stored away. I need to create the DTD declaration and assign this Request_Message to the newly well formed message. Any thoughts? 
 
 
Thanks!! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | elvis_gn | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 11:01 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Padawan
 
 Joined: 08 Oct 2004 Posts: 1905 Location: Dubai 
  | 
		  
		    
			  
				Hi fmv0202,
 
 
The code you pasted seems to create a tag 'Create_NC_Customer'....but the output you need does not require that....
 
 
You should create the DTD declaration and then do a CREATE LASTCHILD OF FROM <stored part of body>
 
 
Regards. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fmv0202 | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 11:05 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 13 Dec 2006 Posts: 28
  
  | 
		  
		    
			  
				I think I'm missing the fundamental concept. How do you create the following line in ESQL? 
 
 
   
	| Code: | 
   
  
	
 
<!DOCTYPE Request_Message SYSTEM "/QIBM/UserData/DB2Extenders/XML/e-commerce/dtd/RequestMessage.dtd"> | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | elvis_gn | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 11:15 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Padawan
 
 Joined: 08 Oct 2004 Posts: 1905 Location: Dubai 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 11:19 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				Set OutputRoot.XMLNS.(XML.DocTypeDecl)Request_Message = '';
 
SET OutputRoot.XMLNS.(XML.DocTypeDecl).(XML.SystemId) ='/QIBM/UserData/DB2Extenders/XML/e-commerce/dtd/RequestMessage.dtd'; _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fmv0202 | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 12:01 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 13 Dec 2006 Posts: 28
  
  | 
		  
		    
			  
				Thanks for the response Jeff. Yes, this is what I had originally thought with the original frame of thinking. Here's the code that doesn't work.
 
 
   
	| Code: | 
   
  
	
 
 
--------------------------------------------------------------------------------
 
 
 
Set OutputRoot.XML.(XML.DocTypeDecl)Request_Message = ''; 
 
SET OutputRoot.XML.(XML.DocTypeDecl).(XML.SystemId) ='/QIBM/UserData/DB2Extenders/XML/e-commerce/dtd/RequestMessage.dtd'; 
 
SET OutputRoot.XML.MyNewMessage = Environment.Stored_Message;
 
 
 | 
   
 
 
 
However, when I looked at the message in debug mode, the XML message body is missing completely.
 
Any way I can assign that third line? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 12:09 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				What is the contents of Environment.Stored_Message?
 
 
How did you populate it?
 
 
Please use XMLNS and not XML domain. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fmv0202 | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 12:12 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 13 Dec 2006 Posts: 28
  
  | 
		  
		    
			  
				Environment_Message looks something like this:
 
 
   
	| Code: | 
   
  
	
 
 
<A>
 
      <B>
 
            </C>
 
      </B>
 
      <B>
 
            </C>
 
      <B>
 
      ...... up to N times B can occur
 
      </D>
 
</A> | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Fri Jun 22, 2007 12:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				
   
	| jefflowrey wrote: | 
   
  
	| How did you populate it? | 
   
 
 _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |