StoneCodeMonkey
Well-known member
- Joined
- Apr 17, 2009
- Messages
- 56
- Programming Experience
- 5-10
I'm trying to create a transform, for the first time, and could use a few pointers.
I am applying the transform to an XML Comment Document produced from Visual Studio. The general structure of the XML file is:
I'm trying to start simple, just getting the assembly name and then looping over the members to return the name. The transform I have thus far...
The only part that works is getting the Assembly name.
I would have thought that the for-each would have simply inserted <p> member name<p/> for each member in the collection.
Can anyone tell me what I am missing?
Regards,
I am applying the transform to an XML Comment Document produced from Visual Studio. The general structure of the XML file is:
VB.NET:
<doc>
<assembly>
<name>MyAssembly</name>
</assembly>
<members>
<member name="T:MyNamespace.MyClasses.MyClass">
<summary>
Provides access to instances of the.
</summary>
</member>
<member name="M:MyNamespace.MyClasses.MyClass.#ctor">
<summary>
Initializes a new instance of the <see cref="MyNamespace.MyClasses.MyClass" /> class.
</summary>
</member>
</members>
</doc>
I'm trying to start simple, just getting the assembly name and then looping over the members to return the name. The transform I have thus far...
VB.NET:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:output method="html"/>
<!--Locates the Assembly Name and Stores for reference-->
<xsl:variable name="AssemblyName">
<xsl:value-of select="doc/assembly/name"/>
</xsl:variable>
<!--Reads entire contents of XML file.-->
<xsl:template match="doc">
<!--Create an HTML output-->
<html>
<body>
<h1>
Visual Studio XML Comment Documentation for
<tt style="font-size: inherit; color: #0000FF; font-style: inherit; font-family: inherit; font-weight: inherit; font-variant: inherit; text-decoration: underline;">
<xsl:value-of select="$AssemblyName"/>
</tt>
</h1>
<xsl:for-each select="member">
<p>
<xsl:value-of select="name"/>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The only part that works is getting the Assembly name.
I would have thought that the for-each would have simply inserted <p> member name<p/> for each member in the collection.
VB.NET:
<xsl:for-each select="member">
<p>
<xsl:value-of select="name"/>
</p>
</xsl:for-each>
Regards,