Page 1 of 1

XML output problem

Posted: Thu Sep 18, 2008 4:03 am
by visgtm
Hi,
I have to convert a sequential file into a xml file. I am using Seq file -> XML output stage. The input seq file format is like:

"1231","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","24534264224"
"1235","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","98795733525"
"1232","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet1","GT644224445"
"1236","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","AE232354566
"1237","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","24526278776"
"1230","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","T4569673234"
"1232","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet1","HT653345244"

I want the output xml file to contain the securityid's of a particular ruleset
inside one RuleSet tag like below:


<RuleSetContainer ruleSetName="RuleSet">
<SecurityID type="ID">AE232354566</SecurityID>
<SecurityID type="ID">24534264224</SecurityID>
<SecurityID type="ID">24526278776</SecurityID>
<SecurityID type="ID">98795733525</SecurityID>
<SecurityID type="ID">T4569673234</SecurityID>
</RuleSetContainer>


<RuleSetContainer ruleSetName="RuleSet1">
<SecurityID type="ID">GT644224445</SecurityID>
<SecurityID type="ID">HT653345244</SecurityID>
</RuleSetContainer>

But i am getting separate RuleSet tag for each securityid's. Please help me solving the problem.

Thanks in advance.

Posted: Thu Sep 18, 2008 6:17 am
by shaonli
Please check the box Repeatation element required and Set Security_Level_Id as key.

Posted: Thu Sep 18, 2008 6:19 am
by shaonli
Please check the box Repeatation element required in XML Output stage and Set SecurityId as key.
It will work.

Thanks
Shaonli

Posted: Thu Sep 18, 2008 8:08 am
by visgtm
Thanks for the reply..

but already i have made the chk on Aggregate all rows, and the securityid is the key column.

what i am getting is 3 securityids inside one ruleset tag, then other 2 securityids inside other ruleset tag, then again remaining 2 securityids inside one ruleset tag. How we can club securityids of one ruleset type together.

Posted: Thu Sep 18, 2008 1:00 pm
by csri
From the input sequential file sort the data using ruleset as sort key and then pass it through the XMLOutput stage. It worked for me. It should work for you.

Posted: Thu Sep 18, 2008 1:01 pm
by csri
SeqFileStage--->SortStage---->XMLOutputStage
(sort by ruleset)

Posted: Thu Sep 18, 2008 10:48 pm
by shaonli
Yes sorting is required because grouping will done as records appears to that stage.By sorting data it will work.It worked in my job.
Thakns
Shaonli

Posted: Fri Sep 19, 2008 3:08 am
by visgtm
Thanks all,
Its working for me.