Subject: [xsl] can I give xsl:number a starting position? From: "Jeff Rosler" <jeff.rosler@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 3 Sep 2002 19:55:43 -0600 |
Hi All, I would like to use xsl:number to handle section numbering in my document, but I need to tell it a section number to start with (i.e. not 1). Can someone tell me if there is an easy way to do this? I was trying the following - <xsl:number count="chapter|h1|h2|h3|h4" format="1.1.A.1.A" level="multiple"/> This works fine, but always starts at 1.1.A.1.A. I tried setting format to the section that I want it to start, but that didn't work. At the moment, I'm thinking that I'll need to write some convoluted code using position() for each section number, but I thought I'd try and post this and see if anyone else has solved this problem before reinventing the wheel :-). Basically, my problem is that I have an XML document that's been chunked up into smaller pieces. I need to convert each of those pieces to HTML separately, with the correct section numbers. In my case, I am doing this by running some Java code that uses JAXP to call the transform (and set a parameter for the XSL with the correct starting section number). My thinking is that I can use the param in my XSL as a starting position to xsl:number (maybe something like the following) - <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" > <xsl:output indent="yes" method="html" omit-xml-declaration="no" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> <xsl:param name="starting_section" /> ... <xsl:number count="chapter|h1|h2|h3|h4" format="$starting_section" level="multiple"/> ... However, since I can't get it to work with a hard coded value, I haven't added the code for the starting_section param Thanks for any and all feedback, Jeff Rosler Consultant Flatirons Solutions Corp 2555 55th Street Suite 100D Boulder, CO 80301 303-544-0514 x11 jeff.rosler@xxxxxxxxxxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] ANN: Microsoft XML Diff and P, Andrew Kimball | Thread | RE: [xsl] can I give xsl:number a s, Michael Kay |
[xsl] avoiding duplicate, Charles Ohana | Date | [xsl] String comparison, Dineen, Geoffrey |
Month |