Click here to Skip to main content
15,896,207 members
Articles / Programming Languages / XML

A Library for Writing/Building Scripts in C#

Rate me:
Please Sign up or sign in to vote.
4.15/5 (6 votes)
14 Oct 2008CPOL3 min read 54.5K   503   55  
Designed to make it easier to write scripts such as JavaScript in C#
<?xml version="1.0" encoding="utf-8"?><configuration><dduetools><builder><components>
				<!--Create skeleton document-->
				<component type="Microsoft.Ddue.Tools.CopyFromFileComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <data file="..\..\Help\Presentation\Style\Transforms\skeleton.xml" />
          <copy source="/*" target="/" />
        </component>
				
				<!--Copy in reflection data-->
				<component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <index name="reflection" value="/reflection/apis/api" key="@id" cache="10">
            <data base="%DXROOT%\Data\Reflection" recurse="true" files="*.xml" />
            <data files=".\reflection.xml" />
          </index>
          <copy name="reflection" source="*" target="/document/reference" />
        </component>
				
				<!--Copy in container data-->
				<component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <copy name="reflection" key="string(/document/reference/containers/namespace/@api)" source="*[not(local-name()='elements')]" target="/document/reference/containers/namespace" />
        </component>
				
				<component type="Microsoft.Ddue.Tools.ForEachComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <variable expression="/document/reference/containers//type/@api" />
          <components>
            <component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
              <copy name="reflection" source="apidata|typedata|templates|attributes" target="/document/reference/containers//type[@api=$key]" />
            </component>
          </components>
        </component>
				
				<!--Copy in explicitInterfaceImplemented reflection data-->
				<component type="Microsoft.Ddue.Tools.ForEachComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
<variable expression="/document/reference/implements/member/@api | /document/reference/implements//type/@api" />
<components>
  <component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
    <copy name="reflection" source="apidata" target="/document/reference/implements//*[@api=$key and not(apidata)]" />
    <copy name="reflection" source="templates" target="/document/reference/implements//*[@api=$key and not(apidata) and not(specialization)]" />
  </component>
</components></component>
				
				<!--Copy in parameter data-->
				<component type="Microsoft.Ddue.Tools.ForEachComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <variable expression="/document/reference/parameters/parameter//type/@api" />
          <components>
  	        <component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
              <copy name="reflection" source="apidata" target="/document/reference/parameters/parameter//type[boolean(@api=$key) and not(apidata)]" />
	          </component>
          </components>
        </component>
				
				<!--Generate syntax-->
				<component type="Microsoft.Ddue.Tools.IfThenComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <if condition="not(starts-with($key,'Overload:') or starts-with($key,'R:'))" />
          <then>
            <component type="Microsoft.Ddue.Tools.SyntaxComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
              <syntax input="/document/reference" output="/document/syntax" />
              <generators>
                 <generator type="Microsoft.Ddue.Tools.VisualBasicDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
		 <generator type="Microsoft.Ddue.Tools.CSharpDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
                <generator type="Microsoft.Ddue.Tools.CPlusPlusDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
		 <generator type="Microsoft.Ddue.Tools.ScriptSharpDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
              </generators>
            </component>
          </then>
        </component>
				
				<!--Copy in comments-->
				<component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <index name="comments" value="/doc/members/member" key="@name" cache="100">
            <data base="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727" recurse="false" files="*.xml" />
            <data files="Comments\*.xml" />
          </index>
          <copy name="comments" source="*" target="/document/comments" />
	  <components>
	    <!-- copy comments for inheritdoc -->
            <component type="Microsoft.Ddue.Tools.InheritDocumentationComponent" assembly="%DXROOT%\ProductionTools\CopyComponents.dll">
		<copy name="comments" use="reflection" />
	    </component>
          </components>
        </component>
				
				<!--Copy in reflection data and comments for members-->
				<component type="Microsoft.Ddue.Tools.ForEachComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <variable expression="/document/reference/elements//element/@api" />
          <components>
            <component type="Microsoft.Ddue.Tools.IfThenComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
              <if condition="not(/document/reference/elements/element[@api=$key]/apidata)" />
              <then>
                <component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
                  <copy name="reflection" source="*[not(self::elements)]" target="/document/reference/elements//element[@api=$key]" />
                </component>
              </then>
            </component>
            <component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
		<copy name="comments" source="summary|overloads|inheritdoc" target="/document/reference/elements//element[@api=$key]" />
		<components>
			<!-- copy comments for inheritdoc -->
            		<component type="Microsoft.Ddue.Tools.InheritDocumentationComponent" assembly="%DXROOT%\ProductionTools\CopyComponents.dll">
				<copy name="comments" use="reflection" />
	    		</component>
          	</components>
            </component>
          </components>
        </component>
				
				<!--Copy in comments for the member's declaring type.-->
				<component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <copy name="comments" key="string(/document/reference/containers/type/@api)" source="summary" target="/document/reference/containers" />
        </component>
				
				<!--Resolve tokens-->
				<component type="Microsoft.Ddue.Tools.SharedContentComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
             <content file="..\..\Help\Settings\tokens.xml" />
             <replace elements="/*//token" item="string(.)" />
           <content file=".\version_content.xml" /></component>
				
				<!--Copy in metadata attributes-->
				<component type="Microsoft.Ddue.Tools.CopyFromIndexComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
              <index name="metadata" value="/metadata/topic" key="@id">
                <data files="..\..\Help\Settings\metadata.xml" />
              </index>
              <copy name="metadata" key="string(&quot;*&quot;)" source="*" target="/document/metadata" />
           </component>
				
				<!--Resolve external links-->
				<component type="DaveSexton.Sandcastle.ResolveExternalLinksComponent" assembly="%DocProjectPath%\bin\DaveSexton.Sandcastle.dll">
             <mappings target="_blank" file="..\..\Help\Settings\links.xml" />
           </component>
				
				<!--transform-->
				<component type="Microsoft.Ddue.Tools.TransformComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <transform file="..\..\Help\Presentation\Style\Transforms\main_sandcastle.xsl">
            <argument key="metadata" value="true" />
             <argument key="languages">
              <language label="VisualBasic" name="VisualBasic" style="vb" />
              <language label="CSharp" name="CSharp" style="cs" />
              <language label="ManagedCPlusPlus" name="ManagedCPlusPlus" style="cpp" />
	  <!--<language label="JSharp" name="JSharp" style="cs" />
              <language label="JScript" name="JScript" style="cs" />-->
	      <language label="JavaScript" name="JavaScript" style="cs" />
            </argument>
          <argument key="bibliographyData" value="../../../Settings/bibliography.xml" /></transform>
        </component>
				
				<!--resolve shared content-->
				<component type="Microsoft.Ddue.Tools.SharedContentComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <content file="..\..\Help\Presentation\Style\content\shared_content.xml" />
          <content file="..\..\Help\Presentation\Style\content\reference_content.xml" />
          <content file="..\..\Help\Presentation\Shared\content\syntax_content.xml" />
	  <content file="..\..\Help\Presentation\Style\content\feedback_content.xml" />
        </component>
				
				<!--resolve reference links-->
				<component type="Microsoft.Ddue.Tools.ResolveReferenceLinksComponent2" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <targets base="%DXROOT%\Data\Reflection" recurse="true" files="*.xml" type="msdn" />
          <targets files=".\reflection.xml" type="local" />
        </component>
				
				<!--save the result-->
				<component type="Microsoft.Ddue.Tools.SaveComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
          <save base=".\Output\html" path="concat(/html/head/meta[@name='file']/@content,'.htm')" indent="true" omit-xml-declaration="true" />
        </component>
</components>
    
  
</builder></dduetools></configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Web Site Advantage
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions