I thought that I might share something that I came up with yesterday to document and debug patch statements
My Format Thousands mod does a shed load of individual line patching and it was getting very difficult to work out which line I was having trouble with especially running it on 3.61 and 4.00 beta 2 (where a load of line patches are meant to not match)
What I needed was some suitable comments. I Googled for comments in XPath 2 and that is possible to do but they don't appear when you get
Cannot match path ..... . Skipping node. errors
I came up with the idea of adding a ['this is a comment'] condition to the select part of each line immediately after the name of the script
['this is a comment'] happens to evaluate to true, so it has no effect on the result of the XPath expression
Code: Select all
<remove sel="/mdscript[@name='Notifications']/cues/library[@name='FormatThousands' and @version < 2]"/>
to
Code: Select all
<remove sel="/mdscript[@name='Notifications']['FormatThousands library already v2']/cues/library[@name='FormatThousands' and @version < 2]"/>
so I now get an error of
Cannot match path '/mdscript[@name='
Notifications']
['FormatThousands library already v2']/cues/library[@name='FormatThousands' and @version < 2]' in patch file 'extensions\format_thousands\md\notifications.xml'. Skipping node.
That tells me what patch file
Notifications to look at and what the patch does so that I can then make a judgement on whether its an error or working as intended. Putting the comment up the front means that you don't have to scroll to the right to see it.
I have added in messages like ['Money formatting - v3.61 and older'] and even ['$AMOUNT$ formatting 302 - all'] so that I can zero in quickly on the right line
Its much easier to see the wood from the trees now
jth