It is not well-formed or even parsed but it is for only to give an
idea. I want to say that I need anchor or pb within the body but not
within the TOC and below code it working upto some extend. It is working with
<head>...</head>
but not working with
<head><title>...</title></head
Thanks a lot !!!
At 01:40 PM 9/19/2008, George Cristian Bina wrote:
Your sample are not good, the input is not well formed and the
output you say you obtain cannot be obtained from the stylesheet you
posted (for example the stylesheet generates a div element that does
not appear in your output.
Try posting complete and correct samples otherwise people need to
spend most of the time fixing your samples than helping you solving
your problem.
Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
J. S. Rawat wrote:
Sorry for the confusion. I am putting this a fresh thread. Any help
is appreciated
INPUT:
<docGroup>
<doc id="FFCP0002-DOC0001">
<head>...</head>
<docBody>
<div type="ss1">
<head>O<sCap>FFICERS</sCap> of the R<sCap>EGIMENT</sCap> of
I<sCap>NFANTRY</sCap><anchor id="JHXMA2911"/><pb n="FFCP0002-477"/></head>
...
</div>
<div type="ss1">
<head>
<title>(1) Extract of a <anchor id=".."/><pb n=".."/>Letter from
Governor <person>William Blount</person> to the Secretary of State</title>
</head>
...
</div>
</doc>
</docGroup>
XSL:
<xsl:template match="doc">
<ul>
<xsl:for-each select="//docGroup//div[(_at_)type='ss1']">
<li><a><xsl:attribute name="href">#sec<xsl:number
format="1" count="//docGroup//div[(_at_)type='ss1']" level="any"
from="docGroup"/></xsl:attribute><xsl:apply-templates
select="head" mode="toc"/> </a> </li>
</xsl:for-each>
</ul>
<div id="content">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="div/head">
<xsl:choose>
<xsl:when test="../@type='ss1'">
<h2>
<xsl:apply-templates/>
</h2>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="div[(_at_)type='ss1']/head" mode="toc">
<xsl:apply-templates select="*[not(name(.)='anchor' or
name(.)='pb')]|text()"/>
</xsl:template>
OUTPUT of above XLT:
<ul>
<li><a href="#sec1">O<span class="sCap">FFICERS</span> of the
R<span class="sCap">EGIMENT</span> of I<span
class="sCap">NFANTRY</span></a></li>
<li><a href="#sec75">(1) Extract of a <a name="..."/><a
name=".."/>Letter from Governor William Blount to the Secretary of
State</a></li>
</ul>
<h2>O<span class="sCap">FFICERS</span> of the R<span
class="sCap">EGIMENT</span> of I<span class="sCap">NFANTRY</span></h2>
<h2>(1) Extract of a <a name=".."/><a name="..."/>Letter from
Governor William Blount to the Secretary of State</h2>
REQUIRED OUTPUT:
<ul>
<li><a href="#sec1">O<span class="sCap">FFICERS</span> of the
R<span class="sCap">EGIMENT</span> of I<span
class="sCap">NFANTRY</span></a></li>
<li><a href="#sec75">(1) Extract of a Letter from Governor William
Blount to the Secretary of State</a></li>
</ul>
<h2>O<span class="sCap">FFICERS</span> of the R<span
class="sCap">EGIMENT</span> of I<span class="sCap">NFANTRY</span></h2>
<h2>(1) Extract of a <a name=".."/><a name="..."/>Letter from
Governor William Blount to the Secretary of State</h2>
Thanks
...JSR
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--