MSI information via XML

Download Report

Transcript MSI information via XML

MSI Information using
XML, XSLT, & CVS
Kakapo Meeting
August 28, 2003
Example XML database file:



http://web.mit.edu/pismere/msilist/
msilist.xml
Stores all the info about managed MSIs.
Contents:



<people>: names of people, teams, groups,
with URLs and contact info
<places>: info about clusters
<msis>: info about our managed MSIs
<msis> contents:

<msi>

<product-name>
• <vendor>
• <title>
• <version>




<category>
<file-url>
<support-url>
<msi-info>






<config-info>
<bug-info>
<license-info>
<packaged-by>
<provided-by>
<last-updated>
• <year>
• <month>
• <day>
An <msi> entry

<msi>

<product-name>

• <vendor>Adobe</vendor>
• <title>Acrobat Reader</title>
• <version>6.0</version>




</product-name>
<category>General
Productivity</category>
<file-url>
file://win.mit.edu/dfs/msi/a
cst/adobe_reader_60/adobe
_reader_mit_60.msi</file-url>
<support-url>
http://www.adobe.com/sup
port/products/acrreader.htm
l</support-url>




• <year>2003</year>• <month>07</month>• <day>10</day>


<msi-info>Extracted MSI after
setup process from vendor
installer using InstallShield
AdminStudio. Provided MSI
and MST did not work in our
environment.</msi-info>
<license-info>free
version</license-info>
<packaged-by>Chad
Dupuis</packaged-by>
<provided-by>Academic
Computing</provided-by>
<last-updated>
</last-updated>
</msi>
Example XSL template file

XSL template files



convert the database into desired output style
are themselves in XML format
Our example:


http://web.mit.edu/pismere/msilist/acst/
msisupport.xsl
Desired output style:
• tree of HTML files
• patterned after Academic Computing msi page
http://web.mit.edu/acs/windows/msisupport.html
• Used HTML Tidy to turn the HTML into viable XML
Msisupport.xsl contents

<xsl:stylesheet>


<xsl:output method=“html”> (output file is html)
<xsl:template match=“/”> (start at top of xml file)
•
•
•
•
•


<html>,<head>,<body>… (create main page)
<xsl:for-each select=“…”> (select <msi>s)
<xsl:sort select=“…”> (group, sort)
<xsl:value-of select=“…”> (display info)
<xsl:call-template name=“create-info-page”>
(make output documents for each msi)
<xsl:template name=“expand-people-name”>
<xsl:template name=“create-info-page”>
• <html>,<head>,<body>… (create new html tree)
• <xsl:value-of select=“pismere:outputDocument…”>
(save to separate file)
Invoking XSLT processor

http://web.mit.edu/pismere/msilist/acst/
generate-html.cmd


Runs “msxsl ..\msilist.xml msisupport.xsl -o
msisupport.html”
In English:
•
•
•
•
Use the MSXSL processor
Use “msilist.xml” as the input file
Use “msisupport.xsl” as the template file
Create “msisupport.html” as the main output file
Results

Creates


http://web.mit.edu/pismere/msilist/acst/
msisupport.html
and the
http://web.mit.edu/pismere/msilist/acst/msiinfo/
directory, containing:
•
•
•
•
adobe_acrobat_reader_50_idafg0o_MSI_README.html
adobe_acrobat_reader_60_idand0o_MSI_README.html
esri_arcinfo_workstation_83_idame0o_MSI_README.html
microsoft_visio_2002_idaah0o_MSI_README.html
Using CVS


Created/edited files on some computer
Checked into CVS


“msilist” module in “pismere-test” repository
on cvs.mit.edu server
Deployed via pismere locker in AFS

Directory hierarchy directly checked out from
same module
• http://web.mit.edu/pismere/msilist/CVS

Redeploying after changes:

A simple “cvs update” in pismere locker
Pros and Cons: XML

PROs





Free
Extremely general, so any structure for
database can be achieved
Understood by a large and increasing number
of browsers/applications
Can use simple text editor to change, or more
xml-aware applications.
CONs


Generality means we make the rules…
and we have to enforce them
Isn’t quite widespread enough to be easily
accessible to laypeople
Pros and Cons: XSLT

PROs




Free
General enough to get just about any
look-and-feel
Is also an XML document,
so same tools can be used to edit
CONs

Difficult to learn, tedious to write
• But: easy enough to parrot and include;
hopefully the tough parts only need to be done once

Still at version 1.0, so not perfected yet
• Multiple output documents not natively supported,
so it forces a choice of a particular processor to
implement (my choice: MSXSL)
Pros and Cons: CVS

PROs



Free
Deployment via AFS
Revision control
• Some file conflict resolution


Recovering older versions
CONs



Usually a command-line client
Learning curve
Some gotchas
• filename capitalization,
• binary/text tags, etc…