Page 1 of 1

More than one XML Repetition path

Posted: Thu Sep 22, 2005 7:01 am
by bakul
A similar message has been posted earlier on the RTI Forum. I am posting it here(with updations) hoping that I might get a response. :)

I want to generate an XML document of the form

Code: Select all


<header>
<city name='CIT'>
  <customer> 
     <name></name>
     <account></account>
   </customer>
   <customer>
     <name></name>
     <account></account>
   </customer>
   <branch>
     <name></name>
     <service></service> 
   </branch>
   <branch>
     <name></name>
     <service></service> 
   </branch>
</city>
</header>
Now to do this I have to make both /header/city/customer and /header/city/branch as repetition paths. The input to XML consists of 5 columns. The input is of the form:

Code: Select all



city     branchname branchservice customername customeraccount
CIT      ABC         Loan              cust1            A1
CIT      XYZ         Loan              cust2            A3

                                
Both /header/city/customer and /header/city/branch (dummy columns) are specified as repetition paths. So now the problem is that for each row of branch and customer account a new city tag is created instead of one city tag.

I want to ask if it is possible to generate such a document using the XML output stage(either in Server or in Enterprise Edition).

Thanks and Regards,
Bakul

Posted: Thu Sep 22, 2005 7:15 pm
by kduke
You cannot read these 2 repeating groups in a server job in one link. It will give you an error. I had this issue in EtlStats. The dsjob.exe will export row counts as XML. There are repeating groups for parameters and links names.

I would process this a sequential file with one column and build the tags manually.

Posted: Fri Sep 23, 2005 2:59 am
by bakul
Could you please give me an example of how to generate XML using sequential file?

Posted: Fri Sep 23, 2005 6:16 am
by kduke
Build a stage variable. Add a CrLf or just Cr for each entry.

svRow = ""
svRow = svRow : "<city name='" : Link.City: "'" : CrLf
... next col

CrLf should be a stage variable set it to char(13):char(10).