Subject: Re: [xsl] Move elements to preceding parent From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 18 Jun 2009 16:15:07 -0400 |
I tried to test the stylesheet with non-<p> elements inside body and I see they break the paragraph.
Input Example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<p dir="rtl">
<span class="chapter">line1</span>
</p>
<p dir="rtl"><span class="regular">line10</span>
<span class="regular">line11</span>
</p>
<p dir="rtl"><span class="regular">line12</span>
</p>
<p dir="rtl"><span class="regular">line13.</span>
</p>
<p dir="rtl"><span class="regular">line14</span>
</p>
<p dir="rtl"><span class="regular">line15</span>
</p>
<h5>
<img src="images/test.jpg" width="35.00" height="30.00" alt="images.jpg" />
</h5> <p dir="rtl"><span class="regular">line16.</span> </p> <p dir="rtl"><span class="regular">line17"</span> </p>
</body> </html>
Output: <?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"> <body> <p dir="rtl"> <span class="chapter">line1</span>
</p> <p dir="rtl"><span class="regular">line10</span> <span class="regular">line11</span> <span class="regular">line12</span> <span class="regular">line13.</span>
</p> <p dir="rtl"><span class="regular">line14</span>
</p> <p dir="rtl"><span class="regular">line15</span>
</p> <h5> <img src="images/test.jpg" width="35.00" height="30.00" alt="images.jpg" />
</h5> <p dir="rtl"><span class="regular">line16.</span>
</p> <p dir="rtl"><span class="regular">line17"</span>
</p> </body> </html>
I thought the <h5> element should be grouped as a seperate group because of the condition group-ending-with="*[not(self::p)] ...
What should I change so the output will be: <?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"> <body> <p dir="rtl"> <span class="chapter">line1</span>
</p> <p dir="rtl"><span class="regular">line10</span> <span class="regular">line11</span> <span class="regular">line12</span> <span class="regular">line13.</span>
</p> <p dir="rtl"><span class="regular">line14</span>
<span class="regular">line15</span> <span class="regular">line16.</span> </p> <h5> <img src="images/test.jpg" width="35.00" height="30.00" alt="images.jpg" />
</h5>
<p dir="rtl"><span class="regular">line17"</span>
</p> </body> </html>
-- Crane Softwrights Ltd. http://www.CraneSoftwrights.com/m/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/m/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Move elements to precedin, Israel Viente | Thread | Re: [xsl] Move elements to precedin, Martin Honnen |
[xsl] XSL with namespace from NVD, Badrul Anuar | Date | Re: [xsl] XSL-FO Processor for Arab, G. Ken Holman |
Month |