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

Re: multi-paragraph blockquotes

Subject: Re: multi-paragraph blockquotes
From: JBryant@xxxxxxxxx
Date: Fri, 6 May 2005 10:24:06 -0500
html blockquot
Hi, Bruce,

How about the following?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <html>
      <head>
        <title>Multi-paragraph Blockquote Test</title>
      </head>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="para">
    <p><xsl:apply-templates/></p>
  </xsl:template>

  <xsl:template match="blockquote">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="blockquote/para">
    <p style="text-indent:.25in"><xsl:apply-templates/></p>
  </xsl:template>

</xsl:stylesheet>

That gave me (edited for spacing):

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Multi-paragraph Blockquote Test</title>
  </head>
  <body>
    <p>Some text:
      <p style="text-indent:.25in">One paragraph.</p>
      <p style="text-indent:.25in">Another paragraph.</p>
    </p>
  </body>
</html>

The result appeared properly indented in IE 6, Firefox 1.0.1, and Opera 
7.54. To get proper XHTML, you'll need to adjust the stylesheet, but the 
concept seems to work (if I understand what you want).

Tested with Saxon 8.4.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




Bruce D'Arcus <bdarcus@xxxxxxxxx> 
05/06/2005 10:04 AM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
XSL-List@xxxxxxxxxxxxxxxxxxxxxx
cc

Subject
 multi-paragraph blockquotes






What's the best way to use XSLT (2.0) to convert this:

<para>Some text:
   <blockquote>
     <para>One paragraph.</para>
     <para>Another paragraph.</para>
   </blockquote>
</para>

... to what XHTML structures such that applications (browsers, but also 
MS Word) will display it right?

I've been using the hack of display-output-escaping, but am not fond of 
that approach.

So, I'm asking an XSLT question, but also an XHTML one as well.

Bruce

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.