Skip to main content

XSL XSLT file for Visual Studio HelpViewer 1.0

This XSL/XSLT file is based on a Visual Studio Help file found in "C:\ProgramData\Microsoft\HelpLibrary\content\Microsoft\store\Development_Frameworks_21823146_VS_100_en-us_9.msha"
I've stripped out the content and replaced with <xsl:if gt;
etc.
The values for this content are taken from XML files which have the corresponding XML element hierachy, e.g



 




<xsl:value-of select="HelpDocument/Meta/title"/>
<xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        
        <meta name="Microsoft.Help.ContentType" content="Reference" >meta>
        <meta name="Microsoft.Help.Locale" content="en-us" >meta>
        <meta name="Microsoft.Help.TopicLocale" content="en-us" >meta>
        <meta name="Microsoft.Help.Category" content="ApiHelp3" >meta>
        <meta name="SelfBranded" content="false" >meta>
        <link href="stylesheets/CSharp.css" type="text/css" rel="Stylesheet" />
 
        
        <title>
          <xsl:value-of select="HelpDocument/Meta/title"/>
        title>
        <xsl:variable name="metaTitleVar">
          <xsl:value-of select="HelpDocument/Meta/metaTitle"/>
        xsl:variable>
        <meta name="Title" content="{$metaTitleVar}" >meta>
 
        <xsl:variable name="metaIDVar">
          <xsl:value-of select="HelpDocument/Meta/metaID"/>
        xsl:variable>
        <meta name="Microsoft.Help.Id" content="{$metaIDVar}">meta>
 
        <xsl:variable name="metaParentVar">
          <xsl:value-of select="HelpDocument/Meta/metaParent"/>
        xsl:variable>
        <meta name="Microsoft.Help.TocParent" content="{$metaParentVar}">meta>
 
        <xsl:variable name="metaKeyword1Var">
          <xsl:value-of select="HelpDocument/Meta/metaKeyword1"/>
        xsl:variable>
        <meta name="Microsoft.Help.Keywords" content="{$metaKeyword1Var}" >meta>
 
        <xsl:variable name="metaKeyword2Var">
          <xsl:value-of select="HelpDocument/Meta/metaKeyword2"/>
        xsl:variable>
        <meta name="Microsoft.Help.Keywords" content="{$metaKeyword1Var}" >meta>
 
        <xsl:variable name="metaF1Var">
          <xsl:value-of select="HelpDocument/Meta/metaF1"/>
        xsl:variable>
        <meta name="Microsoft.Help.F1" content="{$metaF1Var}" >meta>
 
        <xsl:variable name="metaTocOrderVar">
          <xsl:value-of select="HelpDocument/Meta/metaTocOrder"/>
        xsl:variable>
        <meta name="Microsoft.Help.TocOrder" content="{$metaTocOrderVar}" >meta>
        
      head>
      <body class="primary-mtps-offline-document">
        <div class="topic">
          <div class="majorTitle">
            <xsl:value-of selectHelpDocument/HelpBody/majorTitle"/>
          div>
          <div class="title">
            <xsl:value-of select="HelpDocument/HelpBody/title"/>
          div>
 
          <xsl:variable name="feedbackLinkVar">
            <xsl:value-of select="HelpDocument/HelpBody/feedbackLink"/>
          xsl:variable>
          <div class="OH_feedbacklink">
            <a href="mailto:support@avaeon.com?subject=Documentation Feedback:{$feedbackLinkVar}">Send commentsa>
          div>
 
          <div id="mainSection">
            <div id="mainBody">
              <p>
                
              p>
              
               <div>
                <div class="summary">
                  <p>
                    <xsl:copy-of select="HelpDocument/HelpBody/summary/summaryText"/>
                  p>
 
 
                div>
              div>
              <p>
                
              p>
              
              
              
              <xsl:if test="HelpDocument/HelpBody/syntax">
                <CollapsibleArea runat="server" Expanded="1" Title="Syntax" xmlns="http://msdn2.microsoft.com/mtps">
 
                  <xsl:if test="HelpDocument/HelpBody/syntax/codeSnippet">
                    <a id="syntaxToggle" xmlns="http://www.w3.org/1999/xhtml">
                      
                    a>
                    <CodeSnippet runat="server" Language="Gravity" DisplayLanguage="Gravity" ContainsMarkup="false" EnableCopyCode="false">
                      <xsl:copy-of select="HelpDocument/HelpBody/syntax/codeSnippet"/>
                    CodeSnippet>
                  xsl:if>
 
                  
                  <xsl:if test="HelpDocument/HelpBody/syntax/properties">
                    <CollapsibleArea runat="server" Expanded="1" Title="Properties" xmlns="http://msdn2.microsoft.com/mtps">
                      <a id="propertyTableToggle" xmlns="http://www.w3.org/1999/xhtml">
                        
                      a>
                      <table id="memberList1" class="members" xmlns="http://www.w3.org/1999/xhtml">
                        <tr>
                          <th class="iconColumn">
                             
                          th>
                          <th class="nameColumn">Nameth>
                          <th class="descriptionColumn">Descriptionth>
                        tr>
                        <xsl:for-each select="HelpDocument/HelpBody/syntax/properties/property">
                          <xsl:variable name="hierachyVar">
                            <xsl:value-of select="hierachy"/>
                          xsl:variable>
                          
                          
                          <xsl:variable name="hierachyImageVar">
                            <xsl:if test="$hierachyVar='public;declared;'">
                              <xsl:value-of select="'images/IC74937'"/>
                            xsl:if>
                            <xsl:if test="$hierachyVar='public;inherited;'">
                              <xsl:value-of select="'images/IC100399'"/>
                            xsl:if>
                          xsl:variable>
                          <xsl:variable name="hierachyImageAltVar">
                            <xsl:if test="$hierachyVar='public;declared;'">
                              <xsl:value-of select="'Public Property'"/>
                            xsl:if>
                            <xsl:if test="$hierachyVar='public;inherited;'">
                              <xsl:value-of select="'Public Inherited Property'"/>
                            xsl:if>
                          xsl:variable>
                          
                          <tr data="{$hierachyVar}">
                            <td>
                                   <img class="mtps-img-src" alt="{$hierachyImageAltVar}" src="{$hierachyImageVar}" />
                            td>
                            <td>
                              <xsl:variable name="linkUrlVar">
                                <xsl:value-of select="linkUrl"/>
                              xsl:variable>
                              <a class="mtps-internal-link" href="{$linkUrlVar}">
                                <xsl:value-of select="linkUrlName"/>
                              a>
                            td>
                            <td>
                              <span>
                                <xsl:copy-of select="linkUrlDescription"/>
                              span>
                            td>
                          tr>
                           xsl:for-each>
                        
                      table>
                      <a href="#mainBody" xmlns="http://www.w3.org/1999/xhtml">Topa>
                    CollapsibleArea>
                    
                  xsl:if>
 
                  
                  <xsl:if test="HelpDocument/HelpBody/syntax/settings">
                    <CollapsibleArea runat="server" Expanded="1" Title="Settings" xmlns="http://msdn2.microsoft.com/mtps">
                      <a id="propertyTableToggle" xmlns="http://www.w3.org/1999/xhtml">
                        
                      a>
                      <table id="memberList1" class="members" xmlns="http://www.w3.org/1999/xhtml">
                        <tr>
                          <th class="iconColumn">
                             
                          th>
                          <th class="nameColumn">Nameth>
                          <th class="descriptionColumn">Descriptionth>
                        tr>
                        <xsl:for-each select="HelpDocument/HelpBody/syntax/settings/setting">
                          <xsl:variable name="hierachyVar">
                            <xsl:value-of select="hierachy"/>
                          xsl:variable>
 
 
                          <xsl:variable name="hierachyImageVar">
                            <xsl:if test="$hierachyVar='public;declared;'">
                              <xsl:value-of select="'images/IC74937'"/>
                            xsl:if>
                            <xsl:if test="$hierachyVar='public;inherited;'">
                              <xsl:value-of select="'images/IC100399'"/>
                            xsl:if>
                          xsl:variable>
                          <xsl:variable name="hierachyImageAltVar">
                            <xsl:if test="$hierachyVar='public;declared;'">
                              <xsl:value-of select="'Public Setting'"/>
                            xsl:if>
                            <xsl:if test="$hierachyVar='public;inherited;'">
                              <xsl:value-of select="'Public Inherited Setting'"/>
                            xsl:if>
                          xsl:variable>
 
                          <tr data="{$hierachyVar}">
                            <td>
                              <img class="mtps-img-src" alt="{$hierachyImageAltVar}" src="{$hierachyImageVar}" />
                            td>
                            <td>
                              <xsl:variable name="linkUrlVar">
                                <xsl:value-of select="linkUrl"/>
                              xsl:variable>
                              <a class="mtps-internal-link" href="{$linkUrlVar}">
                                <xsl:value-of select="linkUrlName"/>
                              a>
                            td>
                            <td>
                              <span>
                                <xsl:copy-of select="linkUrlDescription"/>
                              span>
                            td>
                          tr>
                        xsl:for-each>
                        
 
                      table>
                      <a href="#mainBody" xmlns="http://www.w3.org/1999/xhtml">Topa>
                    CollapsibleArea>
                    
                  xsl:if>
                  
                  
                  <xsl:if test="HelpDocument/HelpBody/syntax/events">
                    <CollapsibleArea runat="server" Expanded="1" Title="Events" xmlns="http://msdn2.microsoft.com/mtps">
                      <a id="eventTableToggle" xmlns="http://www.w3.org/1999/xhtml">
                        
                      a>
                      <table id="memberList3" class="members" xmlns="http://www.w3.org/1999/xhtml">
                        <tr>
                          <th class="iconColumn">
                             
                          th>
                          <th class="nameColumn">Nameth>
                          <th class="descriptionColumn">Descriptionth>
                        tr>
                        
                        
                        <xsl:for-each select="HelpDocument/HelpBody/syntax/events/event">
                          <xsl:variable name="hierachyVar">
                            <xsl:value-of select="hierachy"/>
                          xsl:variable>
 
                          <tr data="{$hierachyVar}">
                            <td>
                              
                              <img class="mtps-img-src" alt="Public event" src="images/IC90369" />
                            td>
                            <td>
                              <xsl:variable name="linkUrlVar">
                                <xsl:value-of select="linkUrl"/>
                              xsl:variable>
                              <a class="mtps-internal-link" href="{$linkUrlVar}">
                                <xsl:value-of select="linkUrlName"/>
                              a>
                            td>
                            <td>
                              <span>
                                <xsl:copy-of select="linkUrlDescription"/>
                              span>
                            td>
                          tr>
                          
                        xsl:for-each>
                      table>
                      <a href="#mainBody" xmlns="http://www.w3.org/1999/xhtml">Topa>
                    CollapsibleArea>
                    
                  xsl:if>
 
                  
                  <xsl:if test="HelpDocument/HelpBody/syntax/parameters">
                    <div id="parameters" xmlns="http://www.w3.org/1999/xhtml">
                      <h4 class="subHeading">Parametersh4>
                      <xsl:for-each select="HelpDocument/HelpBody/syntax/parameters/parameter">
                        <dl>
                          <dt>
                            <span class="parameter">
                              <xsl:value-of select="name"/>
                            span>
                          dt>
                          <dd>
                            Type:
                            <xsl:variable name="typeLinkVar">
                              <xsl:value-of select="typeLink"/>
                            xsl:variable>
                            <a class="mtps-internal-link" href="{$typeLinkVar}" >
                              <xsl:value-of select="typeLinkNameSpace"/>
                              <LanguageSpecificText runat="server" devLangcs="." devLangvb="." devLangcpp="::" devLangnu="." xmlns="http://msdn2.microsoft.com/mtps">.LanguageSpecificText>
                              <xsl:value-of select="typeName"/>
                            a>
                            <br/>
                            <span>
                              <xsl:value-of select="typeText"/>
                              <br />
                            span>
                          dd>
                        dl>
                      xsl:for-each>
                      
                    div>
                  xsl:if>
 
                  
                  <xsl:if test="HelpDocument/HelpBody/syntax/return">
                    <div id="returns" xmlns="http://www.w3.org/1999/xhtml">
                      <h4 class="subHeading">Return Valueh4>Type:
                      <xsl:variable name="returnTypeLinkVar">
                        <xsl:value-of select="HelpDocument/HelpBody/syntax/return/typeLink"/>
                      xsl:variable>
                      <a class="mtps-internal-link" href="{$returnTypeLinkVar}" >
                        <xsl:value-of select="HelpDocument/HelpBody/syntax/return/typeNameSpace"/>
                        <LanguageSpecificText runat="server" devLangcs="." devLangvb="." devLangcpp="::" devLangnu="." xmlns="http://msdn2.microsoft.com/mtps">.LanguageSpecificText>
                        <xsl:value-of select="HelpDocument/HelpBody/syntax/return/typeName"/>
                      a>
                      <br/>
                      <span>
                        <span>
                          <xsl:value-of select="HelpDocument/HelpBody/syntax/return/typeDescription"/>
                          <span class="parameter">
                            <xsl:value-of select="HelpDocument/HelpBody/syntax/return/typeVar"/>
                          span>.
                        span>
                        <br/>
                        <div class="caption">
                          
                        div>
                        <div class="tableSection">
                          <table>
                            <tr>
                              <th>
                                <p>Return Value p>
                              th>
                              <th>
                                <p>Description p>
                              th>
                            tr>
                            <tr>
                              <td>
                                <p>
                                  <xsl:value-of select="HelpDocument/HelpBody/syntax/return/value"/>
                                p>
                              td>
                              <td>
                                <p>
                                  <xsl:value-of select="HelpDocument/HelpBody/syntax/return/description"/>
                                  <span class="parameter">
                                    <xsl:value-of select="HelpDocument/HelpBody/syntax/return/name"/>
                                  span>.
                                p>
                              td>
                            tr>
                          table>
                        div>
                      span>
                    div>
                  xsl:if>
 
                  <br xmlns="http://www.w3.org/1999/xhtml"/>
                CollapsibleArea>
 
 
 
 
                <xsl:if test="HelpDocument/HelpBody/syntax/exceptions">
                  <CollapsibleArea runat="server" Expanded="1" Title="Exceptions" xmlns="http://msdn2.microsoft.com/mtps">
                    <a id="ddueExceptionsToggle" xmlns="http://www.w3.org/1999/xhtml">
                      
                    a>
                    <div class="tableSection" xmlns="http://www.w3.org/1999/xhtml">
                      <table>
                        <tr>
                          <th class="exceptionNameColumn">Exceptionth>
                          <th class="exceptionConditionColumn">Conditionth>
                          <th class="exceptionConditionColumn">Descriptionth>
                        tr>
                        <xsl:for-each select="HelpDocument/HelpBody/syntax/exceptions/exception">
                          <tr>
                            <td>
                              <span>
                                <xsl:variable name="typeLinkVar">
                                  <xsl:value-of select="typeLink"/>
                                xsl:variable>
                                <a class="mtps-internal-link" href="{$typeLinkVar}" >
                                  <xsl:value-of select="name"/>
                                a>
 
                              span>
                            td>
                            <td>
                              <p>
                                <span class="parameter">
                                  <xsl:value-of select="parameter/value"/>
                                span> <xsl:value-of select="parameter/text"/>
                                <span>
                                  <xsl:variable name="typeLinkVar">
                                    <xsl:value-of select="parameter/typeLink"/>
                                  xsl:variable>
                                  <a class="mtps-internal-link" href="{$typeLinkVar}" >
                                    
                                    <xsl:value-of select="parameter/typeName"/>
                                  a>
                                span>
                              p>
                            td>
                            <td>
                              <p>
                                <xsl:value-of select="description"/>
                              p>
                            td>
                          tr>
                        xsl:for-each>
                      table>
                    div>
                  CollapsibleArea>
                xsl:if>
 
                
                <xsl:if test="HelpDocument/HelpBody/syntax/remarks">
                  <CollapsibleArea runat="server" Expanded="1" Title="Remarks" xmlns="http://msdn2.microsoft.com/mtps">
                    <a id="remarksToggle" xmlns="http://www.w3.org/1999/xhtml">
                      
                    a>
                    <p xmlns="http://www.w3.org/1999/xhtml">
 
                      <xsl:copy-of select="HelpDocument/HelpBody/syntax/remarks/text"/>
                    p>
                  CollapsibleArea>
                xsl:if>
 
                
                <xsl:if test="HelpDocument/HelpBody/syntax/example">
                  <CollapsibleArea runat="server" Expanded="1" Title="Examples" xmlns="http://msdn2.microsoft.com/mtps">
                    <a id="exampleToggle" xmlns="http://www.w3.org/1999/xhtml">
                      
                    a>
                    <p xmlns="http://www.w3.org/1999/xhtml">
                      The following code example demonstrates the
                      <span>
                        <xsl:variable name="exampleLinkVar">
                          <xsl:value-of select="HelpDocument/HelpBody/syntax/example/link"/>
                        xsl:variable>
                        <a class="mtps-internal-link" href="{$exampleLinkVar}" >
                          <xsl:value-of select="HelpDocument/HelpBody/syntax/example/linkText"/>
                        a>
                      span> method.
                    p>
                    <div id="snippetGroup" xmlns="http://www.w3.org/1999/xhtml">
                      <CodeSnippet EnableCopyCode="true" runat="server" Language="Gravity" ContainsMarkup="false" DisplayLanguage="Gravity" xmlns="http://msdn2.microsoft.com/mtps">
                        <xsl:copy-of select="HelpDocument/HelpBody/syntax/example/codeSnippetFull"/>
                      CodeSnippet>
                    div>
                  CollapsibleArea>
                xsl:if>
              
              xsl:if>
                
 
              <xsl:if test="HelpDocument/HelpBody/seeAlsos">
                <CollapsibleArea runat="server" Expanded="1" Title="See Also" xmlns="http://msdn2.microsoft.com/mtps">
                  <a id="seeAlsoToggle" xmlns="http://www.w3.org/1999/xhtml">
                    
                  a>
                  <h4 class="subHeading" xmlns="http://www.w3.org/1999/xhtml">Referenceh4>
 
                  <xsl:for-each select="HelpDocument/HelpBody/seeAlsos/seeAlso">
                    <div class="seeAlsoStyle" xmlns="http://www.w3.org/1999/xhtml">
                      <span>
                        <xsl:variable name="seeAlsoLinkVar">
                          <xsl:value-of select="link"/>
                        xsl:variable>
                        <a class="mtps-internal-link" href="{$seeAlsoLinkVar}" >
                          <xsl:value-of select="text"/>
                        a>
                      span>
                    div>
                  xsl:for-each>
                CollapsibleArea>
              xsl:if>
 
            div>
          div>
        div>
      body>
    html>
 
 
 
 
  xsl:template>
xsl:stylesheet>
 

Comments

Popular posts from this blog

dotNET - Debugging

Debugging with .NET MSIL assemblies Visual Studio and debugging the CLR are different, I'll talk about both. MSIL Assemblies Assemblies compiled with .NET tools such as the CLR compiler are compiled into a file which contains MSIL (Microsoft Intermediate Language). At runtime the contents of the assembly are loaded into the CLR and ran as machine code. When you compile an assembly in debug a PDB file is generated alongside the DLL or EXE you've just created. The link between these 2 files is that the PDB contains the line numbers of the methods and classes as well as the file names of the original source code that created the assembly. When you launch the debugger in Visual Studio the assembly is loaded into the Debugger (similar to the CLR) along with the PDB file. The debugger now uses your PDB file contents to match the running code found in the assembly to locations in source files (hopefully in your present project). CLR CLR Inside Out (msdn magazine) .NET Framework Tools:...

Installer CustomAction, Debugging the CustomAction, InstallState

Custom Action The Custom Action is added to the Setup Project, select the Project node and hit the Custom Action button. This allows you add an Action to a particular phase in the Installation. But first you must create the Custom Action. To Add a Custom Action you must first have a Custom Action created, this is usually in the form of a Installer Class, this should be created in a seperate project, the Installer Class is actually one of the File Templates in the C# Projects. So it's File->New Project and select Visual C# Projects. Then add a Class Library, this will prompt you for the Class Library Types , select "Installer Class". Walkthrough - Creating Custom Action (msdn). Also here's a more comprehensive document on Setup/Installer implementations, it delves into the Registry etc Getting Started with Setup Projects (SimpleTalk). Visual Studio Setup Projects and Custom Actions (Simple Talk). Create your Installer Class and then add it as a Custom Action to the ...

Real-time Web Applications

Your application wants to show live data i.e. data sent from Server back up to the Client instead of the usual which is the Client sending data to the Server via a form submit. There are multiple options, currently the best option is WebSockets. Polling Periodically check the Server for updated data, uses SetInterval in Javascript. The Client sends some information to the Server and wants the Server to send back a response, the response is not immediate so the Client wants to wait for the Server but instead of waiting the Client keeps sending requests to the Server and when something is updated on the Server then the Client updates the UI. ( function poll (){ setTimeout ( function (){ $ . ajax ({ url : "server" , success : function ( data ){ //Update your dashboard gauge salesGauge . setValue ( data . value ); //Setup the next poll recursively poll (); }, dataType : "json" }); }, 30000 ); })(); https://...