I would like to show how XSLT scripts can help with Cognos content maintenance.
Like many modern software tools Cognos stores its internal structures in XML format:
- Report Studio Report sources
Framework Manager Models
Export-Import content packages
LCM data
etc.
With little creativity you can use XSL (eXtensible Stylesheet Language) Transformation or
XSLT to extract useful information from Cognos XML or even modify it.
I used to be a software developer and when I started to mostly implement Cognos solutions I was always looking for automated ways to do different tasks.
Just a few examples from my own experience:
- Find all Cognos objects which are using a specific Cognos object
Extract SQL statements from Report Studio reports
Build advanced reporting from LCM internal data
Generate sections of FM models from existing Models (other BI tools) or Data mappings
Let's say you need to
find all Cognos objects which are dependent on a specified Cognos object.
E.g. you have a data module and would like to know all reports, packages, datasets, shortcuts, report views, jobs, etc. dependent on this module.
The workflow is quite straightforward:
- Export all Cognos Content into non encrypted Cognos Export package
Unzip this package to get a list of XML files
Develop an XSLT script which parses the above files to find all Cognos objects using the specified module
For every found Cognos object recursively find other objects which referring to the first object
Please look at the attached archive which contains:
- cog_package.xsl - XSLT code
package1.xml - an XML content extracted from Cognos 11 samples package
out_package1.xml - an XML output
out_package1.xls - an Excel with imported XML output
r.bat - batch script to run cog_package.xsl transformation
You would also need to download a free Java Saxon XSLT processor
SaxonHE9-9-1-5J.zip from
https://sourceforge.net/projects/saxon/files/Saxon-HE/9.9/
(https://sourceforge.net/projects/saxon/files/Saxon-HE/9.9/)
Quote from: ukflix on 08 Apr 2022 03:42:09 AM
It says attachment not found
I think the site rules changed a while ago, and attachments to posts are no longer supported on Cognoise. If Andrei still has the original file, it could be shared using a third-party site and a URL link to it.
Cheers!
MF.
Quote from: ukflix on 08 Apr 2022 03:42:09 AM
It says attachment not found
Unfortunately, I could not find that Zip file.