[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSL puzzle
Pl. help me find why the xsl would not work for the given xml. Thanks. ---- input.xml ----- <customer name="Test" 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"/> <customer name="C1" 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"/> <customer name="C2" 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"/> <customer name="C3" 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"/> </customer> ---- report.xsl ---- <xslt:transform xmlns:xslt="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- Todo:Set Verbosity level, 5=max (default) --> <xslt:param name="verbosity" select="'5'" />
<!-- 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> <!-- File Systems for the customer --> <!-- More (nested) File systems --> <xslt:apply-templates select="/customer/filesystem"/> <!-- More (nested) Customers <xslt:apply-templates select="/customer"/> --> <!-- More Customers --> <xsl:apply-templates /> <xslt:text>
 </xslt:text> </xslt:template> <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> </xslt:transform>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|