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

Re: generate-id for identical elements

Subject: Re: generate-id for identical elements
From: "Anton Triest" <anton@xxxxxxxx>
Date: Thu, 23 Sep 2004 20:44:45 +0200
identical elements
Jay Bryant wrote:
>
> My concern is not how to get generate-id to accept a string as a path 
> (though I would be curious about that). My concern is to be able to create 
> cross-references to identical elements (that do have different parent 
> elements). I have total control over the XML input and the XSL stylesheet, 
> so I am open to ANY idea that will get the job done.

Hi Jay,

if you have control over the input, couldn't you add an id
to the elements you want to reference, something like

   <chapter title="Chapter 2" id="c2">
     <topic title="Introduction" id="c2-intro"/>
   </chapter>
   <chapter title="Chapter 3" id="c3">
     <topic title="Introduction" id="c3-intro"/>
   </chapter>

then use that id in your ref elements:

   <ref target="c2-intro">Introduction</ref>

Then, in the stylesheet, all you have to do is use the attributes directly:

   <a name="{@id}"/>
   <a href="#{@target}"><xsl:value-of select="."/></a>

Just an idea...
Anton

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.