AGCEventsRCH.xsl 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3. <xsl:script src="AGCEventsXML.js">
  4. <![CDATA[
  5. var g_idResDescriptionBase = 0;
  6. var g_idResFormatBase = 0;
  7. function GetPrefix(node)
  8. {
  9. var attr = node.attributes.getNamedItem("Prefix");
  10. if (attr)
  11. return attr.value;
  12. var theParent = node.parentNode;
  13. return theParent ? GetPrefix(theParent) : "__ERROR_NO_PREFIX__";
  14. }
  15. function SaveDescriptionBase(node)
  16. {
  17. g_idResDescriptionBase = new Number(node.attributes.getNamedItem("ResIDDescription").value);
  18. return g_idResDescriptionBase.toString();
  19. }
  20. function SaveFormatBase(node)
  21. {
  22. g_idResFormatBase = new Number(node.attributes.getNamedItem("ResIDFormat").value);
  23. return g_idResFormatBase.toString();
  24. }
  25. function GetDescriptionID(node, strAttr)
  26. {
  27. var id = new Number(node.attributes.getNamedItem(strAttr).value);
  28. return (g_idResDescriptionBase + id).toString();
  29. }
  30. function GetFormatID(node)
  31. {
  32. var id = new Number(node.attributes.getNamedItem("id").value);
  33. return (g_idResFormatBase + id).toString();
  34. }
  35. ]]>
  36. </xsl:script>
  37. <xsl:template match="/">
  38. <xsl:apply-templates/>
  39. </xsl:template>
  40. <xsl:template match="AGCEvents" xsl:space="preserve">
  41. /////////////////////////////////////////////////////////////////////////////
  42. // <xsl:value-of select="@outputfile"/>
  43. //
  44. // This is an ALWAYS GENERATED file. It should *not* be edited directly.
  45. //
  46. // It was generated at <xsl:value-of select="@time"/> from the following script:
  47. // <xsl:value-of select="@scriptfullname"/>
  48. //
  49. // The input files were:
  50. // <xsl:value-of select="@xmlfile"/>
  51. // <xsl:value-of select="@xslfile"/>
  52. //
  53. // It should be included from resource.h.
  54. //
  55. #define IDS_EventID_Unknown <xsl:eval>SaveDescriptionBase(this)</xsl:eval>
  56. #define IDS_FMT_EventID_Unknown <xsl:eval>SaveFormatBase(this)</xsl:eval>
  57. <xsl:apply-templates/>
  58. </xsl:template>
  59. <xsl:template match="EventGroup" xml:space="preserve">
  60. #define IDS_<xsl:eval>GetPrefix(this)</xsl:eval><xsl:value-of select="@Name"/>_LowerBound <xsl:eval>GetDescriptionID(this, "LowerBound")</xsl:eval>
  61. <xsl:for-each select="Event">
  62. #define IDS_<xsl:eval>GetPrefix(this)</xsl:eval><xsl:value-of select="@Name"/> <xsl:eval>GetDescriptionID(this, "id")</xsl:eval>
  63. #define IDS_FMT_<xsl:eval>GetPrefix(this)</xsl:eval><xsl:value-of select="@Name"/> <xsl:eval>GetFormatID(this)</xsl:eval>
  64. </xsl:for-each>
  65. <xsl:apply-templates select="EventGroup"/>
  66. #define IDS_NAME_<xsl:eval>GetPrefix(this)</xsl:eval><xsl:value-of select="@Name"/>_LowerBound <xsl:eval>GetDescriptionID(this, "UpperBound")</xsl:eval>
  67. </xsl:template>
  68. </xsl:stylesheet>