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

Find position of a node with id attribute

Subject: Find position of a node with id attribute
From: "Robert Ogden" <Robert.Ogden@xxxxxxxx>
Date: Fri, 19 Sep 2003 14:43:23 -0500
javascript find position
Trying to find the position of a node with an attribute id for a href
target

so...code:

<xsl:template match="xref">
   <xsl:variable name="anchor" select="@xrefid"/>
   <xsl:variable name="file">
      <xsl:for-each select="document('a.xml')">
         <xsl:for-each select="//*[@id='$anchor']">
            <!-- Find position of node relative chapter, section,
and/or para0 elements -->
            <!-- Example node resides within 1st chapter, 2nd section,
and 0th para0 element, result would be 1-2-0 -->
            <xsl:number format="1-1-1" level="multiple" count="chapter
|  section | para0"/>
         </xsl:for-each>
      </xsl:for-each>
   </xsl:variable>
   <xsl:variable name="file_num" select="concat('chap', $file,
'.html')"/>
   <!-- For same example as above, result would be chap1-2-0.html#[the
value of $anchor] -->
   <a href="{$file_num}#{$anchor}">
      <xsl:value-of select="$file_num"/>#<xsl:value-of
select="$anchor"/>
   </a>
</xsl:template>

Thanks for any help/ideas

-Robert


**********CONFIDENTIALITY NOTICE**********
The information contained in this e-mail may be confidential and/or 
privileged and is intended for the sole use of the individual or 
organization named above.  If you are not the intended recipient or an 
authorized representative of the intended recipient, any review, copying
or distribution of this e-mail and its attachments, if any, is prohibited.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete this message from your system.


 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.