PageRenderTime 54ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/protobuf-net.1.0.0.280/Tools/vb.xslt

https://bitbucket.org/sparktree/stackexchange.stackid
Extensible Stylesheet Language Transformations | 745 lines | 690 code | 55 blank | 0 comment | 0 complexity | 56c2bc687b38fba4a4240d3d23afb390 MD5 | raw file
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="xsl msxsl"
  5. >
  6. <xsl:import href="common.xslt"/>
  7. <xsl:param name="help"/>
  8. <xsl:param name="xml"/>
  9. <xsl:param name="datacontract"/>
  10. <xsl:param name="binary"/>
  11. <xsl:param name="protoRpc"/>
  12. <xsl:param name="observable"/>
  13. <xsl:param name="preObservable"/>
  14. <xsl:param name="partialMethods"/>
  15. <xsl:param name="detectMissing"/>
  16. <xsl:param name="lightFramework"/>
  17. <xsl:param name="asynchronous"/>
  18. <xsl:param name="clientProxy"/>
  19. <xsl:param name="defaultNamespace"/>
  20. <xsl:key name="fieldNames" match="//FieldDescriptorProto" use="name"/>
  21. <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
  22. <xsl:variable name="types" select="//EnumDescriptorProto | //DescriptorProto"/>
  23. <xsl:variable name="optionXml" select="$xml='true'"/>
  24. <xsl:variable name="optionDataContract" select="$datacontract='true'"/>
  25. <xsl:variable name="optionBinary" select="$binary='true'"/>
  26. <xsl:variable name="optionProtoRpc" select="$protoRpc='true'"/>
  27. <xsl:variable name="optionObservable" select="$observable='true'"/>
  28. <xsl:variable name="optionPreObservable" select="$preObservable='true'"/>
  29. <xsl:variable name="optionPartialMethods" select="$partialMethods='true'"/>
  30. <xsl:variable name="optionDetectMissing" select="$detectMissing='true'"/>
  31. <xsl:variable name="optionFullFramework" select="not($lightFramework='true')"/>
  32. <xsl:variable name="optionAsynchronous" select="$asynchronous='true'"/>
  33. <xsl:variable name="optionClientProxy" select="$clientProxy='true'"/>
  34. <xsl:variable name="optionFixCase" select="$fixCase='true'"/>
  35. <xsl:template match="FileDescriptorSet">
  36. <xsl:if test="$help='true'">
  37. <xsl:message terminate="yes">
  38. VisualBasic template for protobuf-net.
  39. Options:
  40. General:
  41. "help" - this page
  42. Additional serializer support:
  43. "xml" - enable explicit xml support (XmlSerializer)
  44. "datacontract" - enable data-contract support (DataContractSerializer; requires .NET 3.0)
  45. "binary" - enable binary support (BinaryFormatter; not supported on Silverlight)
  46. Other:
  47. "protoRpc" - enable proto-rpc client
  48. "observable" - change notification (observer pattern) support
  49. "preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5)
  50. "partialMethods" - provide partial methods for changes (requires C# 3.0)
  51. "detectMissing" - provide *Specified properties to indicate whether fields are present
  52. "lightFramework" - omit additional attributes not included in CF/Silverlight
  53. "asynchronous" - emit asynchronous methods for use with WCF
  54. "clientProxy" - emit asynchronous client proxy class
  55. </xsl:message>
  56. </xsl:if>
  57. <xsl:if test="$optionXml and $optionDataContract">
  58. <xsl:message terminate="yes">
  59. Invalid options: xml and data-contract serialization are mutually exclusive.
  60. </xsl:message>
  61. </xsl:if>
  62. ' Generated from <xsl:value-of select="name"/>
  63. <xsl:if test="$optionXml">
  64. ' Option: xml serialization ([XmlType]/[XmlElement]) enabled
  65. </xsl:if><xsl:if test="$optionDataContract">
  66. ' Option: data-contract serialization ([DataContract]/[DataMember]) enabled
  67. </xsl:if><xsl:if test="$optionBinary">
  68. ' Option: binary serialization (ISerializable) enabled
  69. </xsl:if><xsl:if test="$optionObservable">
  70. ' Option: observable (OnPropertyChanged) enabled
  71. </xsl:if><xsl:if test="$optionPreObservable">
  72. ' Option: pre-observable (OnPropertyChanging) enabled
  73. </xsl:if><xsl:if test="$partialMethods">
  74. ' Option: partial methods (On*Changing/On*Changed) enabled
  75. </xsl:if><xsl:if test="$detectMissing">
  76. ' Option: missing-value detection (*Specified/ShouldSerialize*/Reset*) enabled
  77. </xsl:if><xsl:if test="not($optionFullFramework)">
  78. ' Option: light framework (CF/Silverlight) enabled
  79. </xsl:if><xsl:if test="$optionProtoRpc">
  80. ' Option: proto-rpc enabled
  81. </xsl:if>
  82. <xsl:apply-templates select="file/FileDescriptorProto"/>
  83. </xsl:template>
  84. <xsl:template match="FileDescriptorProto">
  85. ' Generated from: <xsl:value-of select="name"/>
  86. <xsl:apply-templates select="dependency/string[.!='']"/>
  87. <xsl:variable name="namespace"><xsl:call-template name="PickNamespace">
  88. <xsl:with-param name="defaultNamespace" select="$defaultNamespace"/>
  89. </xsl:call-template>
  90. </xsl:variable>
  91. <xsl:if test="string($namespace) != ''">
  92. Namespace <xsl:value-of select="translate($namespace,':-/\','__..')"/>
  93. </xsl:if>
  94. <xsl:apply-templates select="message_type | enum_type | service"/>
  95. <xsl:if test="string($namespace) != ''">
  96. End Namespace</xsl:if></xsl:template>
  97. <xsl:template match="FileDescriptorProto/dependency/string">
  98. ' Note: requires additional types generated from: <xsl:value-of select="."/></xsl:template>
  99. <xsl:template match="DescriptorProto">
  100. <xsl:choose>
  101. <xsl:when test="$optionDataContract">
  102. &lt;Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="<xsl:value-of select="name"/>")&gt; _
  103. &lt;Global.System.Runtime.Serialization.DataContract(Name:="<xsl:value-of select="name"/>")&gt; _
  104. </xsl:when>
  105. <xsl:when test="$optionXml">
  106. &lt;Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="<xsl:value-of select="name"/>")&gt; _
  107. &lt;Global.System.Xml.Serialization.XmlType(TypeName:="<xsl:value-of select="name"/>")&gt; _
  108. </xsl:when>
  109. <xsl:otherwise>
  110. &lt;Global.System.Serializable, Global.ProtoBuf.ProtoContract(Name:="<xsl:value-of select="name"/>")&gt; _
  111. </xsl:otherwise>
  112. </xsl:choose><!--
  113. -->Public Partial Class <xsl:call-template name="pascal"/>
  114. implements Global.ProtoBuf.IExtensible<!--
  115. --><xsl:if test="$optionBinary">, Global.System.Runtime.Serialization.ISerializable</xsl:if><!--
  116. --><xsl:if test="$optionObservable">, Global.System.ComponentModel.INotifyPropertyChanged</xsl:if><!--
  117. --><xsl:if test="$optionPreObservable">, Global.System.ComponentModel.INotifyPropertyChanging</xsl:if>
  118. Public Sub New
  119. End Sub
  120. <xsl:apply-templates select="*"/><xsl:if test="$optionBinary">
  121. Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext)
  122. MyBase.New()
  123. Global.ProtoBuf.Serializer.Merge(info, Me)
  124. End Sub
  125. Sub GetObjectData(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) implements Global.System.Runtime.Serialization.ISerializable.GetObjectData
  126. Global.ProtoBuf.Serializer.Serialize(info, Me)
  127. End Sub
  128. </xsl:if><xsl:if test="$optionObservable">
  129. Public Event PropertyChanged As Global.System.ComponentModel.PropertyChangedEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
  130. Protected Overridable Sub OnPropertyChanged(ByVal propertyName As String)
  131. RaiseEvent PropertyChanged(Me, New Global.System.ComponentModel.PropertyChangedEventArgs(propertyName))
  132. End Sub
  133. </xsl:if><xsl:if test="$optionPreObservable">
  134. Public Event PropertyChanging As Global.System.ComponentModel.PropertyChangingEventHandler Implements Global.System.ComponentModel.INotifyPropertyChanging.PropertyChanging
  135. Protected Overridable Sub OnPropertyChanging(ByVal propertyName As String)
  136. RaiseEvent PropertyChanging(Me, New Global.System.ComponentModel.PropertyChangingEventArgs(propertyName))
  137. End Sub
  138. </xsl:if>
  139. Private extensionObject As Global.ProtoBuf.IExtension
  140. Function GetExtensionObject(createIfMissing As Boolean) As Global.ProtoBuf.IExtension Implements Global.ProtoBuf.IExtensible.GetExtensionObject
  141. Return Global.ProtoBuf.Extensible.GetExtensionObject(extensionObject, createIfMissing)
  142. End Function
  143. End Class
  144. </xsl:template>
  145. <xsl:template match="DescriptorProto/name | DescriptorProto/extension_range | DescriptorProto/extension"/>
  146. <xsl:template match="
  147. FileDescriptorProto/message_type | FileDescriptorProto/enum_type | FileDescriptorProto/service
  148. | DescriptorProto/field | DescriptorProto/enum_type | DescriptorProto/message_type
  149. | DescriptorProto/nested_type | EnumDescriptorProto/value | ServiceDescriptorProto/method">
  150. <xsl:apply-templates select="*"/>
  151. </xsl:template>
  152. <xsl:template match="EnumDescriptorProto">
  153. Public Enum <xsl:call-template name="pascal"/>
  154. <xsl:apply-templates select="value"/>
  155. End Enum
  156. </xsl:template>
  157. <xsl:template match="EnumValueDescriptorProto">
  158. <xsl:text>
  159. </xsl:text>
  160. <xsl:value-of select="name"/>
  161. <xsl:text xml:space="preserve"> = </xsl:text><xsl:choose>
  162. <xsl:when test="number"><xsl:value-of select="number"/></xsl:when>
  163. <xsl:otherwise>0</xsl:otherwise>
  164. </xsl:choose><xsl:if test="position()!=last()">
  165. </xsl:if>
  166. </xsl:template>
  167. <xsl:template match="FieldDescriptorProto" mode="field">
  168. <xsl:choose>
  169. <xsl:when test="not(key('fieldNames',concat('_',name)))"><xsl:value-of select="concat('_',name)"/></xsl:when>
  170. <xsl:when test="not(key('fieldNames',concat(name,'Field')))"><xsl:value-of select="concat(name,'Field')"/></xsl:when>
  171. <xsl:otherwise><xsl:value-of select="concat('_',generate-id())"/></xsl:otherwise>
  172. </xsl:choose>
  173. </xsl:template>
  174. <xsl:template match="FieldDescriptorProto" mode="format">
  175. <xsl:choose>
  176. <xsl:when test="type='TYPE_DOUBLE' or type='TYPE_FLOAT'
  177. or type='TYPE_FIXED32' or type='TYPE_FIXED64'
  178. or type='TYPE_SFIXED32' or type='TYPE_SFIXED64'">FixedSize</xsl:when>
  179. <xsl:when test="type='TYPE_GROUP'">Group</xsl:when>
  180. <xsl:when test="not(type) or type='TYPE_INT32' or type='TYPE_INT64'
  181. or type='TYPE_UINT32' or type='TYPE_UINT64'
  182. or type='TYPE_ENUM'">TwosComplement</xsl:when>
  183. <xsl:when test="type='TYPE_SINT32' or type='TYPE_SINT64'">ZigZag</xsl:when>
  184. <xsl:otherwise>Default</xsl:otherwise>
  185. </xsl:choose>
  186. </xsl:template>
  187. <xsl:template match="FieldDescriptorProto" mode="primitiveType">
  188. <xsl:choose>
  189. <xsl:when test="not(type)">struct</xsl:when>
  190. <xsl:when test="type='TYPE_DOUBLE'">struct</xsl:when>
  191. <xsl:when test="type='TYPE_FLOAT'">struct</xsl:when>
  192. <xsl:when test="type='TYPE_INT64'">struct</xsl:when>
  193. <xsl:when test="type='TYPE_UINT64'">struct</xsl:when>
  194. <xsl:when test="type='TYPE_INT32'">struct</xsl:when>
  195. <xsl:when test="type='TYPE_FIXED64'">struct</xsl:when>
  196. <xsl:when test="type='TYPE_FIXED32'">struct</xsl:when>
  197. <xsl:when test="type='TYPE_BOOL'">struct</xsl:when>
  198. <xsl:when test="type='TYPE_STRING'">class</xsl:when>
  199. <xsl:when test="type='TYPE_BYTES'">class</xsl:when>
  200. <xsl:when test="type='TYPE_UINT32'">struct</xsl:when>
  201. <xsl:when test="type='TYPE_SFIXED32'">struct</xsl:when>
  202. <xsl:when test="type='TYPE_SFIXED64'">struct</xsl:when>
  203. <xsl:when test="type='TYPE_SINT32'">struct</xsl:when>
  204. <xsl:when test="type='TYPE_SINT64'">struct</xsl:when>
  205. <xsl:when test="type='TYPE_ENUM'">struct</xsl:when>
  206. <xsl:when test="type='TYPE_GROUP' or type='TYPE_MESSAGE'">none</xsl:when>
  207. <xsl:otherwise>
  208. <xsl:message terminate="yes">
  209. Field type not implemented: <xsl:value-of select="type"/> (<xsl:value-of select="../../name"/>.<xsl:value-of select="name"/>)
  210. </xsl:message>
  211. </xsl:otherwise>
  212. </xsl:choose>
  213. </xsl:template>
  214. <xsl:template match="FieldDescriptorProto" mode="type">
  215. <xsl:choose>
  216. <xsl:when test="not(type)">double</xsl:when>
  217. <xsl:when test="type='TYPE_DOUBLE'">Double</xsl:when>
  218. <xsl:when test="type='TYPE_FLOAT'">Single</xsl:when>
  219. <xsl:when test="type='TYPE_INT64'">Long</xsl:when>
  220. <xsl:when test="type='TYPE_UINT64'">ULong</xsl:when>
  221. <xsl:when test="type='TYPE_INT32'">Integer</xsl:when>
  222. <xsl:when test="type='TYPE_FIXED64'">ULong</xsl:when>
  223. <xsl:when test="type='TYPE_FIXED32'">UInteger</xsl:when>
  224. <xsl:when test="type='TYPE_BOOL'">Boolean</xsl:when>
  225. <xsl:when test="type='TYPE_STRING'">String</xsl:when>
  226. <xsl:when test="type='TYPE_BYTES'">Byte()</xsl:when>
  227. <xsl:when test="type='TYPE_UINT32'">UInteger</xsl:when>
  228. <xsl:when test="type='TYPE_SFIXED32'">Integer</xsl:when>
  229. <xsl:when test="type='TYPE_SFIXED64'">Long</xsl:when>
  230. <xsl:when test="type='TYPE_SINT32'">Integer</xsl:when>
  231. <xsl:when test="type='TYPE_SINT64'">Long</xsl:when>
  232. <xsl:when test="type='TYPE_GROUP' or type='TYPE_MESSAGE' or type='TYPE_ENUM'"><xsl:call-template name="pascal">
  233. <xsl:with-param name="value" select="substring-after(type_name,'.')"/>
  234. </xsl:call-template></xsl:when>
  235. <xsl:otherwise>
  236. <xsl:message terminate="yes">
  237. Field type not implemented: <xsl:value-of select="type"/> (<xsl:value-of select="../../name"/>.<xsl:value-of select="name"/>)
  238. </xsl:message>
  239. </xsl:otherwise>
  240. </xsl:choose>
  241. </xsl:template>
  242. <xsl:template match="FieldDescriptorProto[default_value]" mode="defaultValue">
  243. <xsl:choose>
  244. <xsl:when test="type='TYPE_STRING'">"<xsl:value-of select="default_value"/>"</xsl:when>
  245. <xsl:when test="type='TYPE_ENUM'"><xsl:apply-templates select="." mode="type"/>.<xsl:value-of select="default_value"/></xsl:when>
  246. <xsl:when test="type='TYPE_BYTES'"> ' <xsl:value-of select="default_value"/></xsl:when>
  247. <xsl:otherwise>CType(<xsl:value-of select="default_value"/>, <xsl:apply-templates select="." mode="type"/>)</xsl:otherwise>
  248. </xsl:choose>
  249. </xsl:template>
  250. <!--
  251. We need to find the first enum value given .foo.bar.SomeEnum - but the enum itself
  252. only knows about SomeEnum; we need to look at all parent DescriptorProto nodes, and
  253. the FileDescriptorProto for the namespace.
  254. This does an annoying up/down recursion... a bit expensive, but *generally* OK.
  255. Could perhaps index the last part of the enum name to reduce overhead?
  256. -->
  257. <xsl:template name="GetFirstEnumValue">
  258. <xsl:variable name="hunt" select="type_name"/>
  259. <xsl:for-each select="//EnumDescriptorProto">
  260. <xsl:variable name="fullName">
  261. <xsl:for-each select="ancestor::FileDescriptorProto">.<xsl:value-of select="package"/></xsl:for-each>
  262. <xsl:for-each select="ancestor::DescriptorProto">.<xsl:value-of select="name"/></xsl:for-each>
  263. <xsl:value-of select="concat('.',name)"/>
  264. </xsl:variable>
  265. <xsl:if test="$fullName=$hunt"><xsl:value-of select="(value/EnumValueDescriptorProto)[1]/name"/></xsl:if>
  266. </xsl:for-each>
  267. </xsl:template>
  268. <xsl:template match="FieldDescriptorProto[not(default_value)]" mode="defaultValue">
  269. <xsl:choose>
  270. <xsl:when test="type='TYPE_DOUBLE'">0.0</xsl:when>
  271. <xsl:when test="type='TYPE_FLOAT'">0.0F</xsl:when>
  272. <xsl:when test="type='TYPE_INT64'">0L</xsl:when>
  273. <xsl:when test="type='TYPE_UINT64'">0L</xsl:when>
  274. <xsl:when test="type='TYPE_INT32'">0</xsl:when>
  275. <xsl:when test="type='TYPE_FIXED64'">0L</xsl:when>
  276. <xsl:when test="type='TYPE_FIXED32'">0</xsl:when>
  277. <xsl:when test="type='TYPE_BOOL'">False</xsl:when>
  278. <xsl:when test="type='TYPE_STRING'">""</xsl:when>
  279. <xsl:when test="type='TYPE_BYTES'">Nothing</xsl:when>
  280. <xsl:when test="type='TYPE_UINT32'">0</xsl:when>
  281. <xsl:when test="type='TYPE_SFIXED32'">0</xsl:when>
  282. <xsl:when test="type='TYPE_SFIXED64'">0L</xsl:when>
  283. <xsl:when test="type='TYPE_SINT32'">0</xsl:when>
  284. <xsl:when test="type='TYPE_SINT64'">0L</xsl:when>
  285. <xsl:when test="type='TYPE_MESSAGE'">Nothing</xsl:when>
  286. <xsl:when test="type='TYPE_ENUM'"><xsl:apply-templates select="." mode="type"/>.<xsl:call-template name="GetFirstEnumValue"/></xsl:when>
  287. <xsl:otherwise>Nothing</xsl:otherwise>
  288. </xsl:choose>
  289. </xsl:template>
  290. <xsl:template match="FieldDescriptorProto[label='LABEL_OPTIONAL' or not(label)]">
  291. <xsl:variable name="propType"><xsl:apply-templates select="." mode="type"/></xsl:variable>
  292. <xsl:variable name="format"><xsl:apply-templates select="." mode="format"/></xsl:variable>
  293. <xsl:variable name="primitiveType"><xsl:apply-templates select="." mode="primitiveType"/></xsl:variable>
  294. <xsl:variable name="defaultValue"><xsl:apply-templates select="." mode="defaultValue"/></xsl:variable>
  295. <xsl:variable name="field"><xsl:apply-templates select="." mode="field"/></xsl:variable>
  296. <xsl:variable name="specified" select="$optionDetectMissing and ($primitiveType='struct' or $primitiveType='class')"/>
  297. <xsl:variable name="fieldType"><xsl:if test="$specified and $primitiveType='struct'">Nullable(Of </xsl:if><xsl:value-of select="$propType"/><xsl:if test="$specified and $primitiveType='struct'">)</xsl:if></xsl:variable>
  298. <xsl:choose>
  299. <xsl:when test="substring-after($fieldType, 'google.protobuf.')">
  300. Private <xsl:value-of select="concat($field,' As ',substring-after($fieldType, 'google.protobuf.'))"/><xsl:if test="not($specified)"> =<xsl:value-of select="$defaultValue"/></xsl:if>
  301. </xsl:when>
  302. <xsl:otherwise>
  303. Private <xsl:value-of select="concat($field,' As ',$fieldType)"/><xsl:if test="not($specified)"> =<xsl:value-of select="$defaultValue"/></xsl:if>
  304. </xsl:otherwise>
  305. </xsl:choose>
  306. <xsl:choose>
  307. <xsl:when test="not($specified) and $optionXml">
  308. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=False, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  309. <xsl:choose>
  310. <xsl:when test="substring-after($fieldType, 'google.protobuf.')">
  311. &lt;Global.System.ComponentModel.DefaultValue(CType(<xsl:value-of select="$defaultValue"/>, <xsl:value-of select="substring-after($fieldType, 'google.protobuf.')"/>))&gt; _
  312. </xsl:when>
  313. <xsl:otherwise>
  314. &lt;Global.System.ComponentModel.DefaultValue(CType(<xsl:value-of select="$defaultValue"/>, <xsl:value-of select="$fieldType"/>))&gt; _
  315. </xsl:otherwise>
  316. </xsl:choose>
  317. &lt;Global.System.Xml.Serialization.XmlElement("<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>)&gt; _ <!--
  318. --></xsl:when>
  319. <xsl:when test="not($specified) and $optionDataContract">
  320. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=False, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  321. <xsl:choose>
  322. <xsl:when test="substring-after($fieldType, 'google.protobuf.')">
  323. &lt;Global.System.ComponentModel.DefaultValue(CType(<xsl:value-of select="$defaultValue"/>, <xsl:value-of select="substring-after($fieldType, 'google.protobuf.')"/>))&gt; _
  324. </xsl:when>
  325. <xsl:otherwise>
  326. &lt;Global.System.ComponentModel.DefaultValue(CType(<xsl:value-of select="$defaultValue"/>, <xsl:value-of select="$fieldType"/>))&gt; _
  327. </xsl:otherwise>
  328. </xsl:choose>
  329. &lt;Global.System.Runtime.Serialization.DataMember(Name:="<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>, IsRequired:=False)&gt; _ <!--
  330. --></xsl:when>
  331. <xsl:when test="not($specified)">
  332. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=False, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _ <!--
  333. --><xsl:choose>
  334. <xsl:when test="substring-after($fieldType, 'google.protobuf.')">
  335. &lt;Global.System.ComponentModel.DefaultValue(CType(<xsl:value-of select="$defaultValue"/>, <xsl:value-of select="substring-after($fieldType, 'google.protobuf.')"/>))&gt; _ <!--
  336. --></xsl:when>
  337. <xsl:otherwise>
  338. &lt;Global.System.ComponentModel.DefaultValue(CType(<xsl:value-of select="$defaultValue"/>, <xsl:value-of select="$fieldType"/>))&gt; _ <!--
  339. --></xsl:otherwise>
  340. </xsl:choose><!--
  341. --></xsl:when>
  342. <xsl:when test="$optionDataContract">
  343. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=False, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  344. &lt;Global.System.Runtime.Serialization.DataMember(Name:="<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>, IsRequired:=False)&gt; _ <!--
  345. --></xsl:when>
  346. <xsl:when test="$optionXml">
  347. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=False, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  348. &lt;Global.System.Xml.Serialization.XmlElement("<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>)&gt; _ <!--
  349. --></xsl:when>
  350. <xsl:otherwise>
  351. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=False, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _ <!--
  352. --></xsl:otherwise>
  353. </xsl:choose><!--
  354. --><xsl:call-template name="WriteGetSet">
  355. <xsl:with-param name="fieldType" select="$fieldType"/>
  356. <xsl:with-param name="propType" select="$propType"/>
  357. <xsl:with-param name="name"><xsl:call-template name="pascalPropName"/></xsl:with-param>
  358. <xsl:with-param name="field" select="$field"/>
  359. <xsl:with-param name="defaultValue" select="$defaultValue"/>
  360. <xsl:with-param name="specified" select="$specified"/>
  361. </xsl:call-template>
  362. </xsl:template>
  363. <xsl:template name="pascalPropName">
  364. <xsl:param name="value" select="name"/>
  365. <xsl:param name="delimiter" select="'_'"/>
  366. <xsl:variable name="valueUC" select="translate($value,$alpha,$ALPHA)"/>
  367. <xsl:variable name="finalName">
  368. <xsl:choose>
  369. <xsl:when test="$types[translate(name,$alpha,$ALPHA)=$valueUC]"><xsl:value-of select="concat($value,$delimiter,'Property')"/></xsl:when>
  370. <xsl:otherwise><xsl:value-of select="$value"/></xsl:otherwise>
  371. </xsl:choose>
  372. </xsl:variable>
  373. <xsl:call-template name="pascal">
  374. <xsl:with-param name="value" select="$finalName"/>
  375. <xsl:with-param name="delimiter" select="$delimiter"/>
  376. </xsl:call-template>
  377. </xsl:template>
  378. <xsl:template match="FieldDescriptorProto[label='LABEL_REQUIRED']">
  379. <xsl:variable name="type"><xsl:apply-templates select="." mode="type"/></xsl:variable>
  380. <xsl:variable name="format"><xsl:apply-templates select="." mode="format"/></xsl:variable>
  381. <xsl:variable name="field"><xsl:apply-templates select="." mode="field"/></xsl:variable>
  382. Private <xsl:value-of select="concat($field, ' As ', $type)"/>
  383. <xsl:choose>
  384. <xsl:when test="$optionDataContract">
  385. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=True, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  386. &lt;Global.System.Runtime.Serialization.DataMember(Name:="<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>, IsRequired:=True)&gt; _ <!--
  387. --></xsl:when>
  388. <xsl:when test="$optionXml">
  389. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=True, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  390. &lt;Global.System.Xml.Serialization.XmlElement("<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>)&gt; _ <!--
  391. --></xsl:when>
  392. <xsl:otherwise>
  393. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, IsRequired:=True, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _ <!--
  394. --></xsl:otherwise>
  395. </xsl:choose><!--
  396. --><xsl:call-template name="WriteGetSet">
  397. <xsl:with-param name="fieldType" select="$type"/>
  398. <xsl:with-param name="propType" select="$type"/>
  399. <xsl:with-param name="name" select="name"/>
  400. <xsl:with-param name="field" select="$field"/>
  401. </xsl:call-template>
  402. </xsl:template>
  403. <xsl:template name="WriteGetSet">
  404. <xsl:param name="fieldType"/>
  405. <xsl:param name="propType"/>
  406. <xsl:param name="name"/>
  407. <xsl:param name="field"/>
  408. <xsl:param name="specified" select="false()"/>
  409. <xsl:param name="defaultValue"/>
  410. <xsl:variable name="primitiveType"><xsl:apply-templates select="." mode="primitiveType"/></xsl:variable>
  411. <xsl:choose>
  412. <xsl:when test="substring-after($fieldType, 'google.protobuf.')">
  413. Public Property <xsl:value-of select="concat($name,' As ',substring-after($fieldType, 'google.protobuf.'))"/>
  414. </xsl:when>
  415. <xsl:otherwise>
  416. Public Property <xsl:value-of select="concat($name,' As ',$fieldType)"/>
  417. </xsl:otherwise>
  418. </xsl:choose>
  419. Get
  420. <xsl:choose>
  421. <xsl:when test="$specified and $primitiveType='struct'"><!--
  422. -->Return <xsl:value-of select="$field"/><!--
  423. --></xsl:when>
  424. <xsl:when test="$specified">
  425. If Not <xsl:value-of select="$field"/> Is Nothing Then
  426. Return <xsl:value-of select="$field"/>
  427. Else
  428. Return <xsl:value-of select="$defaultValue"/>
  429. End If<!--
  430. --></xsl:when>
  431. <xsl:otherwise><!--
  432. -->Return <xsl:value-of select="$field"/><!--
  433. --></xsl:otherwise>
  434. </xsl:choose>
  435. End Get
  436. <xsl:choose>
  437. <xsl:when test="substring-after($fieldType, 'google.protobuf.')">
  438. Set(<xsl:value-of select="concat('value As ',substring-after($fieldType, 'google.protobuf.'))"/>)
  439. </xsl:when>
  440. <xsl:otherwise>
  441. Set(<xsl:value-of select="concat('value As ',$fieldType)"/>)
  442. </xsl:otherwise>
  443. </xsl:choose>
  444. <xsl:if test="$optionPartialMethods">On<xsl:value-of select="$name"/>Changing(value)
  445. </xsl:if><xsl:if test="$optionPreObservable">OnPropertyChanging("<xsl:value-of select="$name"/>")
  446. </xsl:if><xsl:value-of select="$field"/> = value
  447. <xsl:if test="$optionObservable">OnPropertyChanged("<xsl:value-of select="$name"/>") </xsl:if><xsl:if test="$optionPartialMethods">On<xsl:value-of select="$name"/>Changed()</xsl:if>
  448. End Set
  449. End Property
  450. <xsl:if test="$optionPartialMethods">
  451. partial void On<xsl:value-of select="$name"/>Changing(<xsl:value-of select="$propType"/> value);
  452. partial void On<xsl:value-of select="$name"/>Changed();</xsl:if><xsl:if test="$specified">
  453. &lt;Global.System.Xml.Serialization.XmlIgnore&gt; _
  454. <xsl:if test="$optionFullFramework">&lt;Global.System.ComponentModel.Browsable(false)&gt; _ </xsl:if>
  455. <xsl:choose>
  456. <xsl:when test="$specified and $primitiveType='struct'">
  457. Public Property <xsl:value-of select="$name"/>Specified As Boolean
  458. Get
  459. Return <xsl:value-of select="$field"/>.HasValue
  460. End Get
  461. Set (ByVal value As Boolean)
  462. If Not <xsl:value-of select="$field"/>.HasValue Then
  463. If value = True then <xsl:value-of select="$field"/> = <xsl:value-of select="$name"/>
  464. Else
  465. If value = False then <xsl:value-of select="$field"/> = Nothing
  466. End If
  467. End Set
  468. End Property
  469. </xsl:when>
  470. <xsl:otherwise>
  471. Public Property <xsl:value-of select="$name"/>Specified As Boolean
  472. Get
  473. Return <xsl:value-of select="$field"/> IsNot Nothing
  474. End Get
  475. Set (ByVal value As Boolean)
  476. If <xsl:value-of select="$field"/> Is Nothing Then
  477. If value = True then <xsl:value-of select="$field"/> = <xsl:value-of select="$name"/>
  478. Else
  479. If value = False then <xsl:value-of select="$field"/> = Nothing
  480. End If
  481. End Set
  482. End Property
  483. </xsl:otherwise>
  484. </xsl:choose>
  485. Private Function ShouldSerialize<xsl:value-of select="$name"/>() As Boolean
  486. Return <xsl:value-of select="$name"/>Specified
  487. End Function
  488. Private Sub Reset<xsl:value-of select="$name"/>()
  489. <xsl:value-of select="$name"/>Specified = false
  490. End Sub
  491. </xsl:if>
  492. </xsl:template>
  493. <xsl:template match="FieldDescriptorProto[label='LABEL_REPEATED']">
  494. <xsl:variable name="type"><xsl:apply-templates select="." mode="type"/></xsl:variable>
  495. <xsl:variable name="format"><xsl:apply-templates select="." mode="format"/></xsl:variable>
  496. <xsl:variable name="field"><xsl:apply-templates select="." mode="field"/></xsl:variable>
  497. <xsl:choose>
  498. <xsl:when test="substring-after($type, 'google.protobuf.')">
  499. Private <xsl:if test="not($optionXml)">ReadOnly </xsl:if> <xsl:value-of select="$field"/> as Global.System.Collections.Generic.List(Of <xsl:value-of select="substring-after($type, 'google.protobuf.')" />) = New Global.System.Collections.Generic.List(Of <xsl:value-of select="substring-after($type, 'google.protobuf.')"/>)()
  500. </xsl:when>
  501. <xsl:otherwise>
  502. Private <xsl:if test="not($optionXml)">ReadOnly </xsl:if> <xsl:value-of select="$field"/> as Global.System.Collections.Generic.List(Of <xsl:value-of select="$type" />) = New Global.System.Collections.Generic.List(Of <xsl:value-of select="$type"/>)()
  503. </xsl:otherwise>
  504. </xsl:choose>
  505. <xsl:choose>
  506. <xsl:when test="$optionDataContract">
  507. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  508. &lt;Global.System.Runtime.Serialization.DataMember(Name:="<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>, IsRequired:=False)&gt; _
  509. </xsl:when>
  510. <xsl:when test="$optionXml">
  511. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  512. &lt;Global.System.Xml.Serialization.XmlElement("<xsl:value-of select="name"/>", Order:=<xsl:value-of select="number"/>)&gt; _
  513. </xsl:when>
  514. <xsl:otherwise>
  515. &lt;Global.ProtoBuf.ProtoMember(<xsl:value-of select="number"/>, Name:="<xsl:value-of select="name"/>", DataFormat:=Global.ProtoBuf.DataFormat.<xsl:value-of select="$format"/>)&gt; _
  516. </xsl:otherwise>
  517. </xsl:choose><!--
  518. --><xsl:choose>
  519. <xsl:when test="substring-after($type, 'google.protobuf.')"><!--
  520. -->Public <xsl:if test="not($optionXml)">ReadOnly </xsl:if>Property <xsl:value-of select="name"/> As Global.System.Collections.Generic.List(Of <xsl:value-of select="substring-after($type, 'google.protobuf.')" />)
  521. </xsl:when>
  522. <xsl:otherwise><!--
  523. -->Public <xsl:if test="not($optionXml)">ReadOnly </xsl:if>Property <xsl:value-of select="name"/> As Global.System.Collections.Generic.List(Of <xsl:value-of select="$type" />)
  524. </xsl:otherwise>
  525. </xsl:choose>
  526. Get
  527. Return <xsl:value-of select="$field"/>
  528. End Get
  529. <!----><xsl:if test="$optionXml">
  530. <xsl:choose>
  531. <xsl:when test="substring-after($type, 'google.protobuf.')">
  532. Set (value As Global.System.Collections.Generic.List(Of <xsl:value-of select="substring-after($type, 'google.protobuf.')" />))
  533. </xsl:when>
  534. <xsl:otherwise>
  535. Set (value As Global.System.Collections.Generic.List(Of <xsl:value-of select="$type" />))
  536. </xsl:otherwise>
  537. </xsl:choose>
  538. <xsl:value-of select="$field"/> = value
  539. End Set
  540. </xsl:if>
  541. End Property
  542. </xsl:template>
  543. <xsl:template match="ServiceDescriptorProto">
  544. <xsl:if test="($optionClientProxy or $optionDataContract)">
  545. &lt;Global.System.ServiceModel.ServiceContract(Name:="<xsl:value-of select="name"/>")&gt; _
  546. </xsl:if>
  547. Public Interface I<xsl:value-of select="name"/>
  548. <xsl:apply-templates select="method"/>
  549. End Interface
  550. <xsl:if test="$optionProtoRpc">
  551. Public Class <xsl:value-of select="name"/>Client : Global.ProtoBuf.ServiceModel.RpcClient
  552. public <xsl:value-of select="name"/>Client() : base(typeof(I<xsl:value-of select="name"/>)) { }
  553. <xsl:apply-templates select="method/MethodDescriptorProto" mode="protoRpc"/>
  554. End Class
  555. </xsl:if>
  556. <xsl:apply-templates select="." mode="clientProxy"/>
  557. </xsl:template>
  558. <xsl:template match="MethodDescriptorProto">
  559. <xsl:if test="$optionDataContract">
  560. &lt;Global.System.ServiceModel.OperationContract(Name:="<xsl:value-of select="name"/>")&gt; _
  561. &lt;Global.ProtoBuf.ServiceModel.ProtoBehavior()&gt; _
  562. </xsl:if>
  563. <xsl:apply-templates select="output_type"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="name"/>(<xsl:apply-templates select="input_type"/> request);
  564. <xsl:if test="$optionAsynchronous and $optionDataContract">
  565. &lt;Global.System.ServiceModel.OperationContract(AsyncPattern:=True, Name:="<xsl:value-of select="name"/>")&gt; _
  566. Global.System.IAsyncResult Begin<xsl:value-of select="name"/>(<xsl:apply-templates select="input_type"/> request, Global.System.AsyncCallback callback, object state);
  567. <xsl:apply-templates select="output_type"/> End<xsl:value-of select="name"/>(Global.System.IAsyncResult ar);
  568. </xsl:if>
  569. </xsl:template>
  570. <xsl:template match="MethodDescriptorProto" mode="protoRpc">
  571. <xsl:apply-templates select="output_type"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="name"/>(<xsl:apply-templates select="input_type"/> request)
  572. {
  573. return (<xsl:apply-templates select="output_type"/>) Send("<xsl:value-of select="name"/>", request);
  574. }
  575. </xsl:template>
  576. <xsl:template match="MethodDescriptorProto/input_type | MethodDescriptorProto/output_type">
  577. <xsl:value-of select="substring-after(.,'.')"/>
  578. </xsl:template>
  579. <xsl:template match="MethodDescriptorProto" mode="CompleteEvent">
  580. <xsl:if test="$optionAsynchronous and $optionDataContract">
  581. Public Class <xsl:value-of select="name"/>CompletedEventArgs : Global.System.ComponentModel.AsyncCompletedEventArgs
  582. private object[] results;
  583. public <xsl:value-of select="name"/>CompletedEventArgs(object[] results, Global.System.Exception exception, bool cancelled, object userState)
  584. : base(exception, cancelled, userState)
  585. {
  586. this.results = results;
  587. }
  588. public <xsl:apply-templates select="output_type"/> Result
  589. {
  590. get {
  591. base.RaiseExceptionIfNecessary();
  592. return (<xsl:apply-templates select="output_type"/>)(this.results[0]);
  593. }
  594. }
  595. End Class
  596. </xsl:if>
  597. </xsl:template>
  598. <xsl:template match="ServiceDescriptorProto" mode="clientProxy">
  599. <xsl:if test="$optionAsynchronous and $optionDataContract and $optionClientProxy">
  600. <xsl:apply-templates select="method/MethodDescriptorProto" mode="CompleteEvent"/>
  601. &lt;Global.System.Diagnostics.DebuggerStepThroughAttribute()&gt; _
  602. public partial class <xsl:value-of select="name"/>Client : Global.System.ServiceModel.ClientBase&lt;I<xsl:value-of select="name"/>&gt;, I<xsl:value-of select="name"/>
  603. {
  604. public <xsl:value-of select="name"/>Client()
  605. {}
  606. public <xsl:value-of select="name"/>Client(string endpointConfigurationName)
  607. : base(endpointConfigurationName)
  608. {}
  609. public <xsl:value-of select="name"/>Client(string endpointConfigurationName, string remoteAddress)
  610. : base(endpointConfigurationName, remoteAddress)
  611. {}
  612. public <xsl:value-of select="name"/>Client(string endpointConfigurationName, Global.System.ServiceModel.EndpointAddress remoteAddress)
  613. : base(endpointConfigurationName, remoteAddress)
  614. {}
  615. public <xsl:value-of select="name"/>Client(Global.System.ServiceModel.Channels.Binding binding, Global.System.ServiceModel.EndpointAddress remoteAddress)
  616. : base(binding, remoteAddress)
  617. {}
  618. <xsl:apply-templates select="method/MethodDescriptorProto" mode="clientProxy"/>
  619. }
  620. </xsl:if>
  621. </xsl:template>
  622. <xsl:template match="MethodDescriptorProto" mode="clientProxy">
  623. <xsl:if test="$optionAsynchronous and $optionDataContract and $optionClientProxy">
  624. private BeginOperationDelegate onBegin<xsl:value-of select="name"/>Delegate;
  625. private EndOperationDelegate onEnd<xsl:value-of select="name"/>Delegate;
  626. private Global.System.Threading.SendOrPostCallback on<xsl:value-of select="name"/>CompletedDelegate;
  627. public event Global.System.EventHandler&lt;<xsl:value-of select="name"/>CompletedEventArgs&gt; <xsl:value-of select="name"/>Completed;
  628. public <xsl:apply-templates select="output_type"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="name"/>(<xsl:apply-templates select="input_type"/> request)
  629. {
  630. return base.Channel.<xsl:value-of select="name"/>(request);
  631. }
  632. &lt;Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)&gt; _
  633. public Global.System.IAsyncResult Begin<xsl:value-of select="name"/>(<xsl:apply-templates select="input_type"/> request, Global.System.AsyncCallback callback, object asyncState)
  634. {
  635. return base.Channel.Begin<xsl:value-of select="name"/>(request, callback, asyncState);
  636. }
  637. &lt;Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)&gt; _
  638. public <xsl:apply-templates select="output_type"/> End<xsl:value-of select="name"/>(Global.System.IAsyncResult result)
  639. {
  640. return base.Channel.End<xsl:value-of select="name"/>(result);
  641. }
  642. private Global.System.IAsyncResult OnBegin<xsl:value-of select="name"/>(object[] inValues, Global.System.AsyncCallback callback, object asyncState)
  643. {
  644. <xsl:apply-templates select="input_type"/> request = ((<xsl:apply-templates select="input_type"/>)(inValues[0]));
  645. return this.Begin<xsl:value-of select="name"/>(request, callback, asyncState);
  646. }
  647. private object[] OnEnd<xsl:value-of select="name"/>(Global.System.IAsyncResult result)
  648. {
  649. <xsl:apply-templates select="output_type"/> retVal = this.End<xsl:value-of select="name"/>(result);
  650. return new object[] {
  651. retVal};
  652. }
  653. private void On<xsl:value-of select="name"/>Completed(object state)
  654. {
  655. if ((this.<xsl:value-of select="name"/>Completed != null))
  656. {
  657. InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
  658. this.<xsl:value-of select="name"/>Completed(this, new <xsl:value-of select="name"/>CompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
  659. }
  660. }
  661. public void <xsl:value-of select="name"/>Async(<xsl:apply-templates select="input_type"/> request)
  662. {
  663. this.<xsl:value-of select="name"/>Async(request, null);
  664. }
  665. public void <xsl:value-of select="name"/>Async(<xsl:apply-templates select="input_type"/> request, object userState)
  666. {
  667. if ((this.onBegin<xsl:value-of select="name"/>Delegate == null))
  668. {
  669. this.onBegin<xsl:value-of select="name"/>Delegate = new BeginOperationDelegate(this.OnBegin<xsl:value-of select="name"/>);
  670. }
  671. if ((this.onEnd<xsl:value-of select="name"/>Delegate == null))
  672. {
  673. this.onEnd<xsl:value-of select="name"/>Delegate = new EndOperationDelegate(this.OnEnd<xsl:value-of select="name"/>);
  674. }
  675. if ((this.on<xsl:value-of select="name"/>CompletedDelegate == null))
  676. {
  677. this.on<xsl:value-of select="name"/>CompletedDelegate = new Global.System.Threading.SendOrPostCallback(this.On<xsl:value-of select="name"/>Completed);
  678. }
  679. base.InvokeAsync(this.onBegin<xsl:value-of select="name"/>Delegate, new object[] {
  680. request}, this.onEnd<xsl:value-of select="name"/>Delegate, this.on<xsl:value-of select="name"/>CompletedDelegate, userState);
  681. }
  682. </xsl:if>
  683. </xsl:template>
  684. <xsl:template name="escapeKeyword"><xsl:param name="value"/><xsl:choose>
  685. <xsl:when test="contains($keywordsUpper,concat('|',translate($value, $alpha, $ALPHA),'|'))">[<xsl:value-of select="$value"/>]</xsl:when>
  686. <xsl:otherwise><xsl:value-of select="$value"/></xsl:otherwise>
  687. </xsl:choose></xsl:template>
  688. <xsl:variable name="keywords">|AddHandler|AddressOf|Alias|And|AndAlso|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDec|CDbl|Char|CInt|Class|CLng|CObj|Const|Continue|CSByte|CShort|CSng|CStr|CType|CUInt|CULng|CUShort|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|False|Finally|For|Friend|Function|Get|GetType|GetXMLNamespace|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|Narrowing|New|Next|Not|Nothing|NotInheritable|NotOverridable|Object|Of|On|Operator|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|REM|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|True|Try|TryCast|TypeOf|Variant|Wend|UInteger|ULong|UShort|Using|When|While|Widening|With|WithEvents|WriteOnly|Xor|</xsl:variable>
  689. <xsl:variable name="keywordsUpper" select="translate($keywords, $alpha, $ALPHA)"/>
  690. </xsl:stylesheet>