xsl-list
[Top] [All Lists]

Re: multi-paragraph blockquotes

2005-05-06 08:24:06
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(_at_)gmail(_dot_)com> 
05/06/2005 10:04 AM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
cc

Subject
[xsl] 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


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



<Prev in Thread] Current Thread [Next in Thread>