Result html could be created by :
<xml tr c:\temp\my.xsl MyBindingInfo.xml > c:\temp\mydoc.html
<?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="text()" />
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="Service">
<p>
<h3>service:<b><xsl:value-of select="@Name"/></b></h3>
ports:<br/>
<xsl:apply-templates select="Ports/Port"/>
</p>
</xsl:template>
<xsl:template match="Ports/Port">
Logical Port: <b><xsl:value-of select="@Name"/></b>
Physical
<xsl:apply-templates select="SendPortRef"/>
<xsl:apply-templates select="ReceivePortRef"/>
</xsl:template>
<xsl:template match="SendPortRef">
<xsl:if test="@Name != ''">
Send Port:<b><xsl:value-of select="@Name"/></b><br />
</xsl:if>
</xsl:template>
<xsl:template match="ReceivePortRef">
<xsl:if test="@Name != ''">
Receive Port:<b><xsl:value-of select="@Name"/></b><br/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
No comments:
Post a Comment