MSI Information using XML XSLT CVS Kakapo Meeting

  • Slides: 12
Download presentation
MSI Information using XML, XSLT, & CVS Kakapo Meeting August 28, 2003

MSI Information using XML, XSLT, & CVS Kakapo Meeting August 28, 2003

Example XML database file: n n n http: //web. mit. edu/pismere/msilist/ msilist. xml Stores

Example XML database file: n n n http: //web. mit. edu/pismere/msilist/ msilist. xml Stores all the info about managed MSIs. Contents: n n n <people>: names of people, teams, groups, with URLs and contact info <places>: info about clusters <msis>: info about our managed MSIs

<msis> contents: n <msi> n <product-name> • <vendor> • <title> • <version> n n

<msis> contents: n <msi> n <product-name> • <vendor> • <title> • <version> n n <category> <file-url> <support-url> <msi-info> n n n <config-info> <bug-info> <license-info> <packaged-by> <provided-by> <last-updated> • <year> • <month> • <day>

An <msi> entry n <msi> n <product-name> n • <vendor>Adobe</vendor> • <title>Acrobat Reader</title> •

An <msi> entry n <msi> n <product-name> n • <vendor>Adobe</vendor> • <title>Acrobat Reader</title> • <version>6. 0</version> n n </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/supp ort/products/acrreader. html </support-url> n n • <year>2003</year> • <month>07</month> • <day>10</day> n n <msi-info>Extracted MSI after setup process from vendor installer using Install. Shield Admin. Studio. 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> </msi>

Example XSL template file n XSL template files n n n convert the database

Example XSL template file n XSL template files n n n convert the database into desired output style are themselves in XML format Our example: n n 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 n <xsl: stylesheet> n n <xsl: output method=“html”> (output file is

Msisupport. xsl contents n <xsl: stylesheet> n n <xsl: output method=“html”> (output file is html) <xsl: template match=“/”> (start at top of xml file) • • • n n <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: output. Document…”> (save to separate file)

Invoking XSLT processor n http: //web. mit. edu/pismere/msilist/acst/ generate-html. cmd n n Runs “msxsl.

Invoking XSLT processor n http: //web. mit. edu/pismere/msilist/acst/ generate-html. cmd n n 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 n Creates n n http: //web. mit. edu/pismere/msilist/acst/ msisupport. html and the http:

Results n Creates n n 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_idafg 0 o_MSI_README. html adobe_acrobat_reader_60_idand 0 o_MSI_README. html esri_arcinfo_workstation_83_idame 0 o_MSI_README. html microsoft_visio_2002_idaah 0 o_MSI_README. html

Using CVS n n Created/edited files on some computer Checked into CVS n n

Using CVS n n Created/edited files on some computer Checked into CVS n n “msilist” module in “pismere-test” repository on cvs. mit. edu server Deployed via pismere locker in AFS n Directory hierarchy directly checked out from same module • http: //web. mit. edu/pismere/msilist/CVS n Redeploying after changes: n A simple “cvs update” in pismere locker

Pros and Cons: XML n PROs n n n Free Extremely general, so any

Pros and Cons: XML n PROs n n n 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 n n 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 n PROs n n Free General enough to get just

Pros and Cons: XSLT n PROs n n 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 n Difficult to learn, tedious to write • But: easy enough to parrot and include; hopefully the tough parts only need to be done once n 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 n PROs n n n Free Deployment via AFS Revision

Pros and Cons: CVS n PROs n n n Free Deployment via AFS Revision control • Some file conflict resolution n n Recovering older versions CONs n n n Usually a command-line client Learning curve Some gotchas • filename capitalization, • binary/text tags, etc…