If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

XML output transformation

Started by adik, 11 Apr 2013 08:33:25 AM

Previous topic - Next topic

adik

hi all,

i've scheduled one of my reports to be saved as XML, and it does so, but the way the XML is constructed is not exactly what i need.
is there a way to define a XML template for report output? or some way of getting the XML to look from something like:


<?xml version="1.0" encoding="utf-8" ?>
- <dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
- <!--
<dataset
    xmlns="http://developer.cognos.com/schemas/xmldata/1/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
    xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd"
>


-->
- <metadata>
  <item name="ROOT_NODE_ID" type="xs:decimal" precision="38" />
  <item name="LEVEL1_ID" type="xs:string" length="2002" />
  <item name="LEVEL1_NAME" type="xs:string" length="512" />
  <item name="LEVEL2_ID" type="xs:string" length="2002" />
  <item name="LEVEL2_NAME" type="xs:string" length="512" />
  <item name="LEVEL3_ID" type="xs:string" length="2002" />
  <item name="LEVEL3_NAME" type="xs:string" length="512" />
  <item name="LEVEL4_ID" type="xs:string" length="2002" />
  <item name="LEVEL4_NAME" type="xs:string" length="512" />
  <item name="LEVEL5_ID" type="xs:string" length="2002" />
  <item name="LEVEL5_NAME" type="xs:string" length="512" />
  <item name="LEVEL6_ID" type="xs:string" length="2002" />
  <item name="LEVEL6_NAME" type="xs:string" length="512" />
  <item name="LEVEL7_ID" type="xs:string" length="2002" />
  <item name="LEVEL7_NAME" type="xs:string" length="512" />
  <item name="LEVEL8_ID" type="xs:string" length="2002" />
  <item name="LEVEL8_NAME" type="xs:string" length="512" />
  <item name="LEVEL9_ID" type="xs:string" length="2002" />
  <item name="LEVEL9_NAME" type="xs:string" length="512" />
  <item name="LEVEL10_ID" type="xs:string" length="2002" />
  <item name="LEVEL10_NAME" type="xs:string" length="512" />
  </metadata>
- <data>
- <row>
  <value>5</value>
  <value>5</value>
  <value>Global Root</value>
  <value>41</value>
  <value>Company</value>
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  </row>
- <row>
  <value>5</value>
  <value>5</value>
  <value>Global Root</value>
  <value>41</value>
  <value>Company</value>
  <value>101590</value>
  <value>Customer</value>
  <value>101591</value>
  <value>Customer -All Sites</value>
  <value>125083</value>
  <value>Site 1</value>
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  <value xs:nil="true" />
  </row>
  </data>
  </dataset>


to an output similar to this:


<?xml version="1.0" encoding="UTF-8"?>
<rows>
  <row>
    <ROOT_NODE_ID>5</ROOT_NODE_ID>
    <LEVEL1_ID>5</LEVEL1_ID>
    <LEVEL1_NAME>Global Root</LEVEL1_NAME>
    <LEVEL2_ID>41</LEVEL2_ID>
    <LEVEL2_NAME>Company</LEVEL2_NAME>
    <LEVEL3_ID></LEVEL3_ID>
    <LEVEL3_NAME></LEVEL3_NAME>
    <LEVEL4_ID></LEVEL4_ID>
    <LEVEL4_NAME></LEVEL4_NAME>
    <LEVEL5_ID></LEVEL5_ID>
    <LEVEL5_NAME></LEVEL5_NAME>
    <LEVEL6_ID></LEVEL6_ID>
    <LEVEL6_NAME></LEVEL6_NAME>
    <LEVEL7_ID></LEVEL7_ID>
    <LEVEL7_NAME></LEVEL7_NAME>
    <LEVEL8_ID></LEVEL8_ID>
    <LEVEL8_NAME></LEVEL8_NAME>
    <LEVEL9_ID></LEVEL9_ID>
    <LEVEL9_NAME></LEVEL9_NAME>
    <LEVEL10_ID></LEVEL10_ID>
    <LEVEL10_NAME></LEVEL10_NAME>
</row>
<row>
    <ROOT_NODE_ID>5</ROOT_NODE_ID>
    <LEVEL1_ID>5</LEVEL1_ID>
    <LEVEL1_NAME>Global Root</LEVEL1_NAME>
    <LEVEL2_ID>41</LEVEL2_ID>
    <LEVEL2_NAME>Company</LEVEL2_NAME>
    <LEVEL3_ID>101590</LEVEL3_ID>
    <LEVEL3_NAME>Customer</LEVEL3_NAME>
    <LEVEL4_ID>101591</LEVEL4_ID>
    <LEVEL4_NAME>Customer -All Sites</LEVEL4_NAME>
    <LEVEL5_ID>125083</LEVEL5_ID>
    <LEVEL5_NAME>Site 1</LEVEL5_NAME>
    <LEVEL6_ID></LEVEL6_ID>
    <LEVEL6_NAME></LEVEL6_NAME>
    <LEVEL7_ID></LEVEL7_ID>
    <LEVEL7_NAME></LEVEL7_NAME>
    <LEVEL8_ID></LEVEL8_ID>
    <LEVEL8_NAME></LEVEL8_NAME>
    <LEVEL9_ID></LEVEL9_ID>
    <LEVEL9_NAME></LEVEL9_NAME>
    <LEVEL10_ID></LEVEL10_ID>
    <LEVEL10_NAME></LEVEL10_NAME>
  </row>
</rows>

squish88


adik

what do you mean? i don't understand...