xsl-list
[Top] [All Lists]

[xsl] How to move processing instruction?

2007-04-11 21:44:37
Dear Expert(s):
Could anybody help me to get the following results:

INPUT:
<?page x?>
<?page 1?>
<pub-div type="body" id="C7967-10">
<div type="chapter" id="C7967-11">
<div-meta>
<lrh>MOVIES AND THE REAGAN PRESIDENCY: SUCCESS AND ETHICS</lrh>
<rrh>DEFINING REAGAN-ERA HOLLYWOOD</rrh>
</div-meta>
<label>Chapter 1</label>
<head>Defining Reagan-Era Hollywood</head>
<p>xxxx</p>
</div>
</pub-div>

OUTPUT:
<pub-div type="body" id="C7967-10">
<div type="chapter" id="C7967-11">
<?page x?>
<?page 1?>
<div-meta>
<lrh>MOVIES AND THE REAGAN PRESIDENCY: SUCCESS AND ETHICS</lrh>
<rrh>DEFINING REAGAN-ERA HOLLYWOOD</rrh>
</div-meta>
<label>Chapter 1</label>
<head>Defining Reagan-Era Hollywood</head>
<p>xxxx</p>
</div>
</pub-div>

XSL:
<xsl:template match="div">
<div>
<xsl:if test="preceding-sibling::processing-instruction('page')">
<xsl:apply-templates select="preceding-sibling::processing-instruction('page')[following-sibling::div[1][(_at_)id = current()/@id]]"/>
</xsl:if>
<xsl:apply-templates select="*[not(self::div-meta or self::label or self::head or self::subhead or self::author)]"/>
</xsl:template>

thanks in advance
...Joga S. Rawat


--~------------------------------------------------------------------
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>
--~--