This is not exactly a problem as such but I would like to be able to print out a listing of all the menu items I have in PStart (including all sub folders and items within them).
The only way that I can think to reasonably do this without too much effort is to find an XML viewer that will represent the layout in a nice hierarchical tree-view.
Does anyone have any suggestions of how I might go about this, either programs that will help me or other ways of approaching the problem?
Pstart - print items (solved... I think!)
Pstart - print items (solved... I think!)
Last edited by Darkbee on Sun Nov 26, 2006 1:00 pm, edited 1 time in total.
- Andrew Lee
- Posts: 3084
- Joined: Sat Feb 04, 2006 9:19 am
- Contact:
only problem with this is that it prints out the full source code, which I'll have pages and pages of unnecessary text. All I really need to see is parent folder and item name. I suppose I could manually edit the source until I have what I need but I was hoping to avoid this. What you're suggesting will produce output like this:Andrew Lee wrote:Hmmm, how about opening pstart.xml in Firefox, and hitting File, Print?
Code: Select all
<files name="Audio">
<icon>Icons\audio.ico</icon>
−
<file name="AudioGrabber">
<path>Audio\AudioGrabber\audiograbber.exe</path>
<runcount>7</runcount>
<rundate>2006/11/03 08:51:17</rundate>
</file>
Code: Select all
Audio
-- AudioGrabber
-- XMPlay
Internet
-- Pocket K-Meleon
-- Popman
As a little side note, the XML file contains all the settings for PStart, so there are things in there that I really don't care to print at all.
Thanks for the suggestion though.
For the record, I want to conduct an audit of all the portable applications I've acquired and see if there are any that are surplus to requirements. Now, my app count is not quite running in the hundreds like some, but it'd be nice if I could scribble tough on paper before I go deleting files at will.
It actually occurred to me that there is another way I could approach the problem. Since all of my portable apps are located in one parent folder, I could try doing a directory print of just parent and child folders only (since I have one app per folder). Now I just have to find which directory print program has the most desirable output. The nice thing about doing it this way is that I should be able to get a size per folder in the output too so I can see how much space I'll save by removing various apps.
- Andrew Lee
- Posts: 3084
- Joined: Sat Feb 04, 2006 9:19 am
- Contact:
I've never played with XSLT before, I'm having a bit of trouble getting the output in the form of:Andrew Lee wrote:It's XML, buddy. You can apply a simple XSLT stylesheet to extract whatever you want.
I know, I know, XSLT still feels like pulling teeth without anesthesia sometimes, but for your requirements, it shouldn't be too difficult.
Parent Menu Folder
Child Menu Item
Child Menu Item
Parent Menu Folder
Child Menu Item
etc.
So far I can print out, just all of the child menu items in a flat one column table using the following:
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My PStart Menu</h2>
<table border="1">
<xsl:for-each select="/start/files/files/file">
<tr>
<td><xsl:value-of select="@name"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
This is cool btw, means that users can get exactly the format they want, once they figure out what they're doing!
It also occurred to me that by using a directory print, I can see if there are any items that exist that are not in PStart and vice versa, so using both techniques will allow me to do a bit of housekeeping.
Thanks for the help!
Looks like I was on the right track with the applying templates idea. This code seems to do what i want it to do:
Thanks for the pointers Andrew.
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/start/files">
<html>
<body>
<h2>My PStart Menu</h2>
<table border="1">
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="files">
<tr>
<th><xsl:value-of select="@name"/></th>
</tr>
<xsl:apply-templates select="file"/>
</xsl:template>
<xsl:template match="file">
<tr>
<td><xsl:value-of select="@name"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
- Andrew Lee
- Posts: 3084
- Joined: Sat Feb 04, 2006 9:19 am
- Contact:
This takes care of cascaded groups as well:
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/start/files">
<html>
<body>
<p><b>My PStart Menu</b></p>
<ul><xsl:apply-templates/></ul>
</body>
</html>
</xsl:template>
<xsl:template match="files">
<li><b><xsl:value-of select="@name"/></b></li>
<ul><xsl:apply-templates/></ul>
</xsl:template>
<xsl:template match="file">
<li><xsl:value-of select="@name"/></li>
</xsl:template>
</xsl:stylesheet>