[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: generating ID strings that are both readable and
Thanks David & 'Xmlizer', however I would prefer to avoid solutions based on either generate-id() or xsl:number. Ideally I would like to produce an output XML document which contains entries like <section id="introduction-1"><title>Introduction</title>...</section> ... <section id="examples"><title>Examples</title>...</section> ... <section id="introduction-2"><title>Introduction</title>...</section> ... and so on. I think I could probably manage to do this using keys in XSL 2.0 because I would be able to construct the key using the existing id attribute if there was one, or using the translated title child if there wasn't, and I could create an id attribute based on the number of identical keys. However this mechanism isn't possible in XSL 1.0, and unfortunately - because this stylesheet is to be invoked as part of Framemaker's save XML file logic - it has to be handled by the Xalan processor. Is there another approach? Cheers Trevor -----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: Tuesday, 14 October 2008 9:04 p.m. To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: generating ID strings that are both readable and unique I tend to avoid generate-id() for this as it makes recreating the same ids if the source is edited (or even if it is not) very hard, which means people#s bookmarks get messed up if you regenerte. One fairly robust way is to go <xsl:attribute name="id"> <xsl:text>id.</xsl:text> <xsl:number count="*" level="multiple"/> </xsl:attribute/>
|
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
|