etresoft wrote:
It may be a few hours before I get time to work on it.
Or not.
Here is your XML file:
<?xml version="1.0" encoding="UTF-8"?>
<info>
<ver>2.1.1</ver>
<tag>abc</tag>
<name>Product Name</name>
<filename>productname</filename>
<copyright>2008</copyright>
</info>
This generates the cd product file:
<?xml version="1.0"?>
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="xml" indent="yes" version="1.0" encoding="UTF-8"
doctype-system="http://www.apple.com/DTDs/PropertyList-1.0.dtd"
doctype-public="-//Apple Computer//DTD PLIST 1.0//EN"/>
<!-- You could access addition data from some other XML file. -->
<!-- <xsl:variable name="data" select="document('data.xml')/data"/> -->
<xsl:template match="info">
<plist version="1.0">
<dict>
<key>hfs-openfolder</key>
<string>.</string>
<key>hfs-volume-name</key>
<string><xsl:value-of select="name"/></string>
<key>hide-hfs</key>
<string>./{Norton,*.txt,*.exe,.inf}</string>
<key>hide-iso</key>
<string>./{PDS,*Rename,readme,.Volume*,Norton*,*icns,Run*.app,Icon*,Desktop*,TheFolder}</string>
<key>hide-joliet</key>
<string>./{PDS,*Rename,readme,.Volume*,Norton*,*icns,Run*.app,Icon*,Desktop*,TheFolder}</string>
<key>iso-volume-name</key>
<string><xsl:value-of select="tag"/></string>
<key>joliet-volume-name</key>
<string><xsl:value-of select="name"/></string>
</dict>
</plist>
</xsl:template>
</xsl:stylesheet>
and this generates the Mac read me file in XML:
<?xml version="1.0"?>
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="xml" indent="yes" version="1.0" encoding="UTF-8"/>
<!-- You could access addition data from some other XML file. -->
<!-- <xsl:variable name="data" select="document('data.xml')/data"/> -->
<xsl:template match="info">
<!-- You don't have to deal with these entities anymore. You should be
able to save this xsl file in UTF-8 format and just type in the
bullets. But the entities work too. -->
<readme_mac><xsl:value-of select="concat(name, ' ', ver)"/>
Copyright <xsl:value-of select="copyright"/>, Laureate Learning Systems¨, Inc.
Minimum System Requirements:
Â¥ 300 MHz or faster PowerPC, Intel or better CPU
Â¥ Mac OS 8.1 or later, including any Mac OS X
Â¥ 64 MB available RAM
Â¥ 60 MB available disk space
</readme_mac>
</xsl:template>
</xsl:stylesheet>
This one will output the readme in HTML:
<?xml version="1.0"?>
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="html" indent="yes" version="4.0" encoding="UTF-8"/>
<!-- You could access addition data from some other XML file. -->
<!-- <xsl:variable name="data" select="document('data.xml')/data"/> -->
<xsl:template match="info">
<!-- You don't have to deal with these entities anymore. You should be
able to save this xsl file in UTF-8 format and just type in the
bullets. But the entities work too. -->
<html>
<head>
<title><xsl:value-of select="concat(name, ' ', ver)"/></title>
</head>
<body>
<xsl:value-of select="concat(name, ' ', ver)"/>
Copyright <xsl:value-of select="copyright"/>, Laureate Learning Systems¨, Inc.
- Minimum System Requirements:
- 300 MHz or faster PowerPC, Intel or better CPU
- Mac OS 8.1 or later, including any Mac OS X
- 64 MB available RAM
- 60 MB available disk space
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Yes. I do enjoy XSL quite a bit 🙂