To transform an XML-file with the help of an XSLT you need an XSLT-processor. Luckily Windows already has one,
you will just need a small tool to access it.
- Download my mylod-modifier.xsl
- Download msxsl.exe, a small command-line-tool from Microsoft which will do the transforming.
- Export your collection to XML
- Put all 3 files into the same directory
- Right-click msxsl.exe and choose: "Send to → Desktop (create shortcut)"
- Right-click on this desktop-link and choose: "Properties" at the bottom of the context menu.
In the Shortcut-tab in the target-field extend
"msxsl.exe" to "msxsl.exe collection.xml mylod-modifier.xsl -o mylod.xml"
Now simply double-click the link and msxls.exe will produce a file called mylod.xml.
Point the MyLoDUpdater to this new XML and your changes will show up after the next update.
Some small notes on how this files works:
In the basic version you downloaded it simply copies every profile with all the information from the original collection.xml with commands like e.g.
<xsl:copy-of select="ID"/>. The fun starts once you uncomment some of the already existing exceptions, more to come if needed.
If you do uncomment lines for data-fields like CollectionType for example comment the simple xsl:copy-of-line out.
- <xsl:if test="(CollectionType/@IsPartOfOwnedCollection='true' and CollectionNumber >= 0)">
On default every profile is copied. If you use this query only "Owned" profiles with a Collection-Number will be copied.
Useful to omit Child-Profiles if those don't have Collection-Numbers. Don't forget to uncomment </xsl:if> !
- <xsl:if test="(CollectionType/@IsPartOfOwnedCollection='true' and CollectionNumber >= 0) or (contains(CollectionType, 'Ordered') and CountAs >= 1)">
Similar to the above, but "Ordered" with a Count-As greater than 0 will also be included.
- <xsl:call-template name="CollectionType"/>
Instead of just copying the Collection-Type with <xsl:copy-of select="CollectionType"/> this command calls another
template (sub-program) which tests whether the profile has a "Watched"-Event, and if not assigns the profile to a
Collection called "Unwatched" on which you can filter in MyLoD.
- <CountryOfOrigin><xsl:text> - Location: </xsl:text><xsl:value-of select="Discs/Disc/Location"/></CountryOfOrigin>
Replaces the Country of Origin with the Location of the first disc. Useful if you want to display the Location but can let go of the CoO.
- <RunningTime><xsl:call-template name="Running"/></RunningTime>
For my peculiar way of handling RunningTimes. Only my Child-profiles (if present) have RT, the Parent has "0 min".
For TV-Season I only copy the Parent, thus losing the RT. This Template sums the RTs of the Child-profiles and
puts them to the Parent.