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

position of arbitrary parent

Subject: position of arbitrary parent
From: Laurence O Garfield <lgarfiel@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 17 Jul 2001 12:55:02 -0500 (CDT)
 position of arbitrary parent
I'm back with another one...

I'm trying to parse through two input files, one is DocBook the other is
XHTML that serves as a template.  The template file has alternate
namespace tags within it to trigger certain actions.  However, I'm not
sure how to tell where in the DocBook source I am at a given point in the
template.  For example, I have the template:

<xsl:template match="/">
	<xsl:for-each select="chapter">
		<xsl:apply-templates select="$chapterTemplate/html" />
	</xsl:for-each>
</xsl:template>


That should call the template file for each <chapter> element in the book.
However, later on I need to intercept certain tags and replace them with
the chapter number.  That is,

<xsl:template match="call:insert[@id='ChapTitle']">
	<xsl:apply-templates select="$source/book/chapter/title"/>
</xsl:template>

Where <call:insert id="ChapTitle" /> is a placeholder in the template
file.  How do I determine in the position() of the <chapter> from which it
is being called so that I can call back to it with the
<xsl:apply-templates /> tag?

Am I still technically within the same tree?  If so, then I should be able
to use select="//chapter/title", shouldn't I?  Although elsewhere in the
stylesheet I will need to reference the next and previous <chapter> tags
to the current one as well, which leaves me back with needing to know the
position() of the current <chapter> element.


--Larry Garfield
lgarfiel@xxxxxxxxxxxxxxxxxxx

-- "If at first you don't succeed, skydiving isn't for you." :-)


 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.