Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.7 KiB

  1. <?xml version="1.0"?>
  2. <!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  4. <xsl:output encoding="utf-16" omit-xml-declaration ="yes"/>
  5. <xsl:template match="/" xml:space="preserve">
  6. <xsl:apply-templates select="//INSTANCE"/>
  7. </xsl:template>
  8. <xsl:template match="INSTANCE" xml:space="preserve">
  9. <xsl:apply-templates select="PROPERTY|PROPERTY.ARRAY|PROPERTY.REFERENCE"/>
  10. </xsl:template>
  11. <xsl:template match="PROPERTY" xml:space="preserve"><xsl:value-of select="@NAME"/>=<xsl:apply-templates select="VALUE"><xsl:with-param name="type"><xsl:value-of select="@TYPE"/></xsl:with-param></xsl:apply-templates>
  12. </xsl:template>
  13. <xsl:template match="PROPERTY.ARRAY" xml:space="preserve"><xsl:value-of select="@NAME"/>=<xsl:apply-templates select="VALUE.ARRAY"><xsl:with-param name="includequotes">true</xsl:with-param><xsl:with-param name="type"><xsl:value-of select="@TYPE"/></xsl:with-param></xsl:apply-templates>
  14. </xsl:template>
  15. <xsl:template match="PROPERTY.REFERENCE" xml:space="preserve"><xsl:value-of select="@NAME"/>=<xsl:apply-templates select="VALUE.REFERENCE"></xsl:apply-templates>
  16. </xsl:template>
  17. <xsl:template match="VALUE.REFERENCE">"<xsl:apply-templates select="INSTANCEPATH/NAMESPACEPATH"/><xsl:apply-templates select="INSTANCEPATH/INSTANCENAME|INSTANCENAME"/>"</xsl:template>
  18. <xsl:template match="NAMESPACEPATH">\\<xsl:value-of select="HOST/text()"/><xsl:for-each select="LOCALNAMESPACEPATH/NAMESPACE">\<xsl:value-of select="@NAME"/></xsl:for-each>:</xsl:template>
  19. <xsl:template match="INSTANCENAME"><xsl:value-of select="@CLASSNAME"/><xsl:for-each select="KEYBINDING"><xsl:if test="position()=1">.</xsl:if><xsl:value-of select="@NAME"/>="<xsl:value-of select="KEYVALUE/text()"/>"<xsl:if test="position()!=last()">,</xsl:if></xsl:for-each></xsl:template>
  20. <xsl:template match="VALUE.ARRAY"><xsl:param name="type"/>{<xsl:for-each select="VALUE">
  21. <xsl:apply-templates select=".">
  22. <xsl:with-param name="type">
  23. <xsl:value-of select="$type"/>
  24. </xsl:with-param>
  25. <xsl:with-param name="includequotes">true</xsl:with-param>
  26. </xsl:apply-templates>
  27. <xsl:if test="position()!=last()">,</xsl:if>
  28. </xsl:for-each>}</xsl:template>
  29. <xsl:template match="VALUE">
  30. <xsl:param name="type"/>
  31. <xsl:param name="includequotes"/>
  32. <xsl:choose>
  33. <xsl:when test="$type='string'">
  34. <xsl:if test="$includequotes='true'">"</xsl:if><xsl:value-of select="."/><xsl:if test="$includequotes='true'">"</xsl:if>
  35. </xsl:when>
  36. <xsl:when test="$type='char16'">
  37. '<xsl:value-of select="."/>'
  38. </xsl:when>
  39. <xsl:otherwise>
  40. <xsl:value-of select="."/>
  41. </xsl:otherwise>
  42. </xsl:choose>
  43. </xsl:template>
  44. </xsl:stylesheet>