|
Subject: RE: [xsl] Problem with xsl:number formatting From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 09 Aug 2007 11:20:47 -0400 |
Thanks for your response. I get a different answer when I try your script. When I view the file in Internet Explorer I get:
T:\ftemp2>type bruce.xml
<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet
type="text/xsl" href="test.xsl"?> <root>
<CSU_Category Name="Interface">
<CSU Name="Analog Input Interface" >
<Template Name="C_Module_Template">
</Template>
</CSU>
<CSU Name="Analog Output Interface" >
<Template Name="F_Module_Template" >
</Template>
</CSU>
<CSU Name="Other Interface" >
<Template Name="Other_Interface_Template" >
</Template>
</CSU>
</CSU_Category>
<CSU_Category Name="Interface">
<CSU Name="Analog Input Interface" >
<Template Name="C_Module_Template">
</Template>
</CSU>
<CSU Name="Analog Output Interface" >
<Template Name="F_Module_Template" >
</Template>
</CSU>
<CSU Name="Other Interface" >
<Template Name="Other_Interface_Template" >
</Template>
</CSU>
</CSU_Category>
<CSU_Category Name="Interface">
<CSU Name="Analog Input Interface" >
<Template Name="C_Module_Template">
</Template>
</CSU>
<CSU Name="Analog Output Interface" >
<Template Name="F_Module_Template" >
</Template>
</CSU>
<CSU Name="Other Interface" >
<Template Name="Other_Interface_Template" >
</Template>
</CSU>
</CSU_Category>
<CSU_Category Name="Interface">
<CSU Name="Analog Input Interface" >
<Template Name="C_Module_Template">
</Template>
</CSU>
<CSU Name="Analog Output Interface" >
<Template Name="F_Module_Template" >
</Template>
</CSU>
<CSU Name="Other Interface" >
<Template Name="Other_Interface_Template" >
</Template>
</CSU>
</CSU_Category>
</root>T:\ftemp2>type bruce2.xsl <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="CSU">
<br/>
<xsl:for-each select="ancestor::CSU_Category">
<xsl:number format="A."
value="count(preceding-sibling::CSU_Category)+5"/>
</xsl:for-each>
<xsl:number level="multiple" format="1"
count="CSU_Category|CSU" /> CSU: <xsl:value-of select="@Name"/>
<br/>
<xsl:apply-templates/>
</xsl:template><xsl:template match="Template">
<xsl:for-each select="ancestor::CSU_Category">
<xsl:number format="A."
value="count(preceding-sibling::CSU_Category)+5"/>
</xsl:for-each>
<xsl:number level="multiple" format="1.1"
count="CSU_Category|CSU|Template"/> SWInterface: <xsl:value-of
select="SWInterface_Name"/>
<br/>
<xsl:apply-templates/>
</xsl:template>T:\ftemp2>type bruce.out
<?xml version="1.0" encoding="utf-8"?>
E CSU Category: Interface<br/>
<br/>E.1.1 CSU: Analog Input Interface<br/>
E.1.1.1 SWInterface: <br/>
<br/>E.1.2 CSU: Analog Output Interface<br/> E.1.2.1 SWInterface: <br/>
<br/>E.1.3 CSU: Other Interface<br/> E.1.3.1 SWInterface: <br/>
F CSU Category: Interface<br/>
<br/>F.2.1 CSU: Analog Input Interface<br/>
F.2.1.1 SWInterface: <br/>
<br/>F.2.2 CSU: Analog Output Interface<br/> F.2.2.1 SWInterface: <br/>
<br/>F.2.3 CSU: Other Interface<br/> F.2.3.1 SWInterface: <br/>
G CSU Category: Interface<br/>
<br/>G.3.1 CSU: Analog Input Interface<br/>
G.3.1.1 SWInterface: <br/>
<br/>G.3.2 CSU: Analog Output Interface<br/> G.3.2.1 SWInterface: <br/>
<br/>G.3.3 CSU: Other Interface<br/> G.3.3.1 SWInterface: <br/>
H CSU Category: Interface<br/>
<br/>H.4.1 CSU: Analog Input Interface<br/>
H.4.1.1 SWInterface: <br/>
<br/>H.4.2 CSU: Analog Output Interface<br/> H.4.2.1 SWInterface: <br/>
<br/>H.4.3 CSU: Other Interface<br/> H.4.3.1 SWInterface: <br/>
-- Upcoming public training: XSLT/XSL-FO Sep 10, UBL/code lists Oct 1 World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Jul'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Problem with xsl:number f, Budinger [US], Bruce | Thread | RE: [xsl] Problem with xsl:number f, Michael Kay |
| RE: [xsl] Problem with xsl:number f, Budinger [US], Bruce | Date | RE: [xsl] Problem with xsl:number f, Michael Kay |
| Month |