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

Re: How to move processing instruction?

Subject: Re: How to move processing instruction?
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Mon, 16 Apr 2007 15:32:46 +0530
Re:  How to move processing instruction?
OK!!! Please check the below and sorry for the inconvenience!!


XSL
<xsl:template match="processing-instruction('page')" mode="move">
<xsl:processing-instruction name="page"><xsl:value-of select="."/></xsl:processing-instruction>
</xsl:template>
<xsl:template match="div">
<div>
<xsl:attribute name="type">
<xsl:choose>
<xsl:when test="@type='part'">part</xsl:when>
<xsl:otherwise>chapter</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="preceding-sibling::processing-instruction('page')">
<xsl:apply-templates select="preceding-sibling::processing-instruction('page')[following-sibling::div[1][@id = current()/@id]]" mode="move" />
</xsl:if>
</div>
</xsl:template>


INPUT
<publication>
<?page 1?>
<?page 2?>
<pub-div type="body" id="C1">
<div type="chapter" id="C2">
...
</div>
<?page 3?>
<?page 4?>
<div type="chapter" id="C3">
...
</div>
</pub-div>
</publication>


OUTPUT <body> <div type="chapter"/> <div type="chapter"> <?page 3?> <?page 4?> </div> </body>


REQUIRED OUTPUT <body> <div type="chapter"> <?page 1?> <?page 2?> </div> <div type="chapter"> <?page 3?> <?page 4?> </div> </body>


At 11:47 AM 4/16/2007 +0200, you wrote:
J. S. Rawat wrote:
Please you check your input and cross-check it with my INPUT as shown below


At 12:29 PM 4/16/2007 +0300, you wrote:
Double checked...


It is clear that the code you posted or even both the code and your input file are different in your test than what you posted...

JS, you are not making it easy to help. Please post a minimized working sample of XSLT, input / output. I too was looking at your problem, but since in/out was not the same data you used for testing your XSLT, we can't help you further. Don't ask for re-check etc, instead provide us with more insight in your problem. We like to help, but we can't create solutions of thin air.


-- Abel

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.