|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
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
|

Cart








