XSLT에 대한 경험이 없습니다. 나는 W3C에서 하나를 포함하여 몇 가지 온라인 튜토리얼을 시도했지만 성공하지는 못했다. Visual Studio Code Metrics 명령 줄 도구로 만든 XML에서 HTML 페이지를 생성하려고합니다.XSLT 지원?
<Module Name="TestVS10XML.dll" AssemblyVersion="1.0.0.0" FileVersion="1.0.0.0">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="97" />
<Metric Name="CyclomaticComplexity" Value="10" />
<Metric Name="ClassCoupling" Value="8" />
<Metric Name="DepthOfInheritance" Value="5" />
<Metric Name="LinesOfCode" Value="4" />
</Metrics>
하지 아래에있는 모든 네임 스페이스 정보 : 만 보고서가 최상위 메트릭을 포함 할
<?xml version="1.0" encoding="utf-8"?>
<CodeMetricsReport Version="10.0">
<Targets>
<Target Name="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Bin\Debug\TestVS10XML.dll">
<Modules>
<Module Name="TestVS10XML.dll" AssemblyVersion="1.0.0.0" FileVersion="1.0.0.0">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="97" />
<Metric Name="CyclomaticComplexity" Value="10" />
<Metric Name="ClassCoupling" Value="8" />
<Metric Name="DepthOfInheritance" Value="5" />
<Metric Name="LinesOfCode" Value="4" />
</Metrics>
<Namespaces>
<Namespace Name="TestVS10XML">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="97" />
<Metric Name="CyclomaticComplexity" Value="10" />
<Metric Name="ClassCoupling" Value="8" />
<Metric Name="DepthOfInheritance" Value="5" />
<Metric Name="LinesOfCode" Value="4" />
</Metrics>
<Types>
<Type Name="_Default">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="91" />
<Metric Name="CyclomaticComplexity" Value="2" />
<Metric Name="ClassCoupling" Value="5" />
<Metric Name="DepthOfInheritance" Value="4" />
<Metric Name="LinesOfCode" Value="2" />
</Metrics>
<Members>
<Member Name="Page_Load(object, EventArgs) : void" File="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Default.aspx.cs" Line="14">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="90" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="4" />
<Metric Name="LinesOfCode" Value="1" />
</Metrics>
</Member>
<Member Name="_Default()">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="1" />
</Metrics>
</Member>
</Members>
</Type>
<Type Name="SiteMaster">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="2" />
<Metric Name="ClassCoupling" Value="3" />
<Metric Name="DepthOfInheritance" Value="5" />
<Metric Name="LinesOfCode" Value="1" />
</Metrics>
<Members>
<Member Name="Page_Load(object, EventArgs) : void" File="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Site.Master.cs" Line="13">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="0" />
</Metrics>
</Member>
<Member Name="SiteMaster()">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="1" />
</Metrics>
</Member>
</Members>
</Type>
<Type Name="Global">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="6" />
<Metric Name="ClassCoupling" Value="2" />
<Metric Name="DepthOfInheritance" Value="2" />
<Metric Name="LinesOfCode" Value="1" />
</Metrics>
<Members>
<Member Name="Application_Start(object, EventArgs) : void" File="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Global.asax.cs" Line="14">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="0" />
</Metrics>
</Member>
<Member Name="Application_End(object, EventArgs) : void" File="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Global.asax.cs" Line="20">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="0" />
</Metrics>
</Member>
<Member Name="Application_Error(object, EventArgs) : void" File="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Global.asax.cs" Line="26">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="0" />
</Metrics>
</Member>
<Member Name="Session_Start(object, EventArgs) : void" File="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Global.asax.cs" Line="32">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="0" />
</Metrics>
</Member>
<Member Name="Session_End(object, EventArgs) : void" File="C:\Users\rs02130\Documents\Visual Studio 2010\Projects\TestVS10XML\TestVS10XML\Global.asax.cs" Line="38">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="0" />
</Metrics>
</Member>
<Member Name="Global()">
<Metrics>
<Metric Name="MaintainabilityIndex" Value="100" />
<Metric Name="CyclomaticComplexity" Value="1" />
<Metric Name="ClassCoupling" Value="1" />
<Metric Name="LinesOfCode" Value="1" />
</Metrics>
</Member>
</Members>
</Type>
</Types>
</Namespace>
</Namespaces>
</Module>
</Modules>
</Target>
</Targets>
</CodeMetricsReport>
: 같은 XML은 보인다. 나는이 XSLT (모듈 이름도 포함하고 있지 않다.)를 생각해 냈지만, 나는 그것을 실행할 때 열 머리글 만 얻었고 테이블에는 데이터가 없었다. 내가 W3C에서 온라인 자습서가 믿지 않는
<?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" indent="yes"/>
<xsl:template match="/">
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="1"
style="font-family:verdana;font-size:10pt;border:1">
<tr>
<td width="20%" align="left" >
Maintainability Index
</td>
<td width="20%" align="left">
Cyclomatic Complexity
</td>
<td width="20%" align="left">
Class Coupling
</td>
<td width="20%" align="left">
Depth Of Inheritance
</td>
<td width="20%" align="left">
Lines Of Code
</td>
</tr>
</table>
<xsl:for-each select="Targets/Modules/Metrics">
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="1"
style="font-family:verdana;font-size:10pt;border:1">
<tr >
<td width="20%" align="left" >
<xsl:value-of select="MaintainabilityIndex"/>
</td>
<td width="20%" align="left" >
<xsl:value-of select="CyclomaticComplexity"/>
</td>
<td width="20%" align="left" >
<xsl:value-of select="ClassCoupling"/>
</td>
<td width="20%" align="left" >
<xsl:value-of select="DepthOfInheritance"/>
</td>
<td width="20%" align="left" >
<xsl:value-of select="LinesOfCode"/>
</td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
: 어떤 도움을 크게
XSLT ... 감사합니다. w3schools를 언급하는 경우 W3C와 관련이 없습니다. 일반적으로, 나는 이런 종류의 튜토리얼로부터 XSLT를 배우려고 시도하는 것이 좋은 접근 방법이 아니라고 생각한다. 개념을 제대로 설명하는 훌륭한 책을 읽으십시오. –