[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

can I give xsl:number a starting position?

Subject: can I give xsl:number a starting position?
From: "Jeff Rosler" <jeff.rosler@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 3 Sep 2002 19:55:43 -0600
xsl number start
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.