|
Subject: [xsl] XSL puzzle From: "Roshan Sharma" <roshansharma@xxxxxxxxxxx> Date: Wed, 07 Mar 2001 19:36:59 |
Pl. help me find why the xsl would not work for the given xml. Thanks.
contact-phone="510-555-1212" storage-class-id="2" contact-person="Tom Hamel" contact-email="tom@xxxxxxxx" billing-name="Test, Inc." id="1_2" space="100000000000"> <filesystem fsname="homedirs"
id="1_100" space-quota="1200000000000"/>
contact-phone="510-555-1212" storage-class-id="2" contact-person="Mr C1" contact-email="C1@xxxxxx" billing-name="C1 Inc" id="1_3" space="4000000000000"/>
contact-phone="510-555-1212" storage-class-id="2" contact-person="Mr C2" contact-email="blah@xxxxxxxx" billing-name="C2 Inc" id="1_4" space="3000000000000"/>
contact-phone="510-555-1212" storage-class-id="2" contact-person="Mr C3" contact-email="c3" billing-name="C3 Inc" id="1_5" space="3000000000000"/>
<!-- Todo:Set Verbosity level, 5=max (default) --> <xslt:param name="verbosity" select="'5'" />
<xslt:template match="customer"> <!-- Customer Name --> <xslt:text> Customer Name: </xslt:text> <xslt:value-of select="@name" /> <!-- Contact Phone Number --> <xslt:if test="@contact-number"> <xslt:text>
 Contact Phone No.: </xslt:text> <xslt:value-of select="@contact-number" /> </xslt:if>
<!-- Storage Class ID -->
<xslt:if test="@storage-class-id">
<xslt:text>
 Storage Class ID: </xslt:text>
<xslt:value-of select="@storage-class-id" />
</xslt:if> <!-- Contact Person Name -->
<xslt:if test="@contact-person">
<xslt:text>
 Contact Person Name: </xslt:text>
<xslt:value-of select="@contact-person" />
</xslt:if> <!-- Contact Person Email -->
<xslt:if test="@contact-email">
<xslt:text>
 Contact E-mail: </xslt:text>
<xslt:value-of select="@contact-email" />
</xslt:if> <!-- Billing Name -->
<xslt:if test="@billing-name">
<xslt:text>
 Billing Name: </xslt:text>
<xslt:value-of select="@billing-name" />
</xslt:if > <!-- Capacity -->
<xslt:if test="@space">
<xslt:text>
 </xslt:text>
<xslt:text>
 Capacity : </xslt:text>
<xslt:value-of select="@space div 1000" />
<xslt:text> KB </xslt:text>
<xslt:text>
 </xslt:text>
</xslt:if><!-- More (nested) File systems --> <xslt:apply-templates select="/customer/filesystem"/>
<!-- More (nested) Customers <xslt:apply-templates select="/customer"/> --> <!-- More Customers --> <xsl:apply-templates />
<xslt:template match="filesystem">
<xslt:text>
	 File System Name: </xslt:text>
<xslt:value-of select="@fsname" />
<xslt:if test="@storage-class-id">
<xslt:text>
	 Storage Class ID: </xslt:text>
<xslt:value-of select="@storage-class-id" />
</xslt:if>
<xslt:if test="@space-quota">
<xslt:text>
	 Capacity: </xslt:text>
<xslt:value-of select="@space-quota div 1000" />
<xslt:text> KB </xslt:text>
<xslt:text>
 </xslt:text>
</xslt:if>
</xslt:template>
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] XSL puzzle, Don Bruey | Thread | RE: [xsl] XSL puzzle, Michael Kay |
| RE: [xsl] return nodeset to xsl:var, Evan Lenz | Date | RE: [xsl] sorting question, Diamond, Jason |
| Month |