ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Multiple XML file creation at File output Node

Post new topic  Reply to topic
 Multiple XML file creation at File output Node « View previous topic :: View next topic » 
Author Message
harsha_sg
PostPosted: Thu May 15, 2014 11:32 am    Post subject: Multiple XML file creation at File output Node Reply with quote

Newbie

Joined: 01 May 2014
Posts: 5

I've been working on XML based proj ..,where i need to Create 2 different files at file output node separating on an condition.
Something like guess my XML Input has 3 different fields Name,ID,Designation..,I need to create two different XML output files Separated upon the Designation's [Only one File output Node has to be used]

How Can i implement this,,??

Though am getting..,its not in well-formed XML format...Everytime i propagate the content thru compute node output..,the next message will be created in a new 'Root'

Message Flow
File_Input>>>Compute>>File_Output

I've Used DFDL parser for parsing the Pipe delimetted my input

Please Help me out in solving This
Thank You
Back to top
View user's profile Send private message
Esa
PostPosted: Thu May 15, 2014 11:16 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

PROPAGATE
Using local environment variables with file nodes
Back to top
View user's profile Send private message
harsha_sg
PostPosted: Fri May 16, 2014 12:48 am    Post subject: Reply with quote

Newbie

Joined: 01 May 2014
Posts: 5

Can u elaborate

I've this code

Code:
 DECLARE I INTEGER 1;
            DECLARE J INTEGER;
            DECLARE K INTEGER 1;
            DECLARE L INTEGER 1;
           
            SET J = CARDINALITY(InputRoot.DFDL.DFDL_Message.*[]);
           
            WHILE I <= J DO
                 
            IF InputRoot.DFDL.DFDL_Message.body[I].Designation='Programmer' THEN
            SET OutputLocalEnvironment.Destination.File.Directory='D:\DFDL_POC\OUT\PAT\';
         SET OutputLocalEnvironment.Destination.File.Name ='PAT.xml';
         SET OutputLocalEnvironment.Destination.File.Action='Append to existing file';
         SET OutputLocalEnvironment.Destination.File.TimeStamp=CURRENT_TIMESTAMP;
         
       
        SET OutputRoot.XMLNSC[1].Root.body[K]=InputRoot.DFDL.DFDL_Message.body[I];
       
       
       
 
     
                 
            ELSEIF InputRoot.DFDL.DFDL_Message.body[I].Designation='MANAGER' THEN
            SET OutputLocalEnvironment.Destination.File.Directory='D:\DFDL_POC\OUT\MANAGER\';
         SET OutputLocalEnvironment.Destination.File.Name ='MAG.xml';
         SET OutputLocalEnvironment.Destination.File.Action='Append to existing file';
         SET OutputLocalEnvironment.Destination.File.TimeStamp=CURRENT_TIMESTAMP;
         
         
           SET OutputRoot.XMLNSC[2].Root.body[L]=InputRoot.DFDL.DFDL_Message.body[I];
         
           
         
 
            END IF;     
          SET I = I + 1;
         
      PROPAGATE TO TERMINAL 'out' delete NONE;
           
            END WHILE;





But Not in Well-Formed XML format
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri May 16, 2014 1:13 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

So you're not appending but getting a new file, every time?
I'd expect this would be because of this line:
Code:
SET OutputLocalEnvironment.Destination.File.TimeStamp=CURRENT_TIMESTAMP;

As to well formed XML.... well if your content is XML you have to write the declaration and opening tags down to the repeating element manually, then again all the closing tags manually...
For that I'd use the BLOB domain...
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
harsha_sg
PostPosted: Sun May 18, 2014 9:59 pm    Post subject: Reply with quote

Newbie

Joined: 01 May 2014
Posts: 5

fjb_saper wrote:
So you're not appending but getting a new file, every time?
I'd expect this would be because of this line:
Code:
SET OutputLocalEnvironment.Destination.File.TimeStamp=CURRENT_TIMESTAMP;

As to well formed XML.... well if your content is XML you have to write the declaration and opening tags down to the repeating element manually, then again all the closing tags manually...
For that I'd use the BLOB domain...
Have fun


Am getting single file with mutiple Data as per requirement..,But for every XML data a new Root[Base tag] tag is created..,which is resulting in not a well formed XML file.

Please help me out in debugging this
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon May 19, 2014 12:48 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
for every XML data a new Root[Base tag] tag is created..,which is resulting in not a well formed XML file
You have correctly identified the problem. The solution is simple : output the document start tag before the flow starts, and then output the closing tag after it ends.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Multiple XML file creation at File output Node
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.