You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Drasko Kokic <dr...@yahoo.com> on 2000/09/05 17:21:56 UTC

once again: formating output document

Hello there,

It's hard to belive that no one could shed some light
on this topic ... why the following XSL code:


  <xsl:template match="STOCKINFO">
    <xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>

    <HTML>
      <HEAD>
        <TITLE><xsl:value-of select="TITLE"/></TITLE>
      </HEAD>

      <BODY bgcolor="#FFFFFF">
        <CENTER>

          <TABLE border="1" width="80%"
cellpadding="4">
            <TR>
              <TD bgcolor="{$title-bg-color}"
align="left" colspan="4" rowspan="1" valign="top">
                <BIG><BIG><xsl:value-of
select="TITLE"/></BIG></BIG>
                at <xsl:value-of
select="/STOCKINFO/SYSDATE/ROWSET/ROW/SYSDATE/."/>
              </TD>
            </TR>
            <TR>
              <TH>BID_PRICE</TH>
              <TH>BID_SIZE</TH>
              <TH>ASK_PRICE</TH>
              <TH>ASK_SIZE</TH>
            </TR>
            <TR>
              <TD><xsl:value-of
select="STOCK//BID_PRICE"/></TD>
              <TD><xsl:value-of
select="STOCK//BID_SIZE"/></TD>
              <TD><xsl:value-of
select="STOCK//ASK_PRICE"/></TD>
              <TD><xsl:value-of
select="STOCK//ASK_SIZE"/></TD>
            </TR>
          </TABLE>

          <BR/>Your portfolio contains
<B><xsl:value-of select="TOTAL//QUANTITY"/></B>
shares.
          
        </CENTER>
      </BODY>
    </HTML>
  </xsl:template>


produces following HTML code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML><HEAD><TITLE>Stock Information on
INSP</TITLE></HEAD><BODY
bgcolor="#FFFFFF"><CENTER><TABLE border="1"
cellpadding="4"
width="80%"><TR><TD align="left" bgcolor="#c0c0c0"
colspan="4"
rowspan="1" valign="top"><BIG><BIG>Stock Information
on INSP</BIG></BIG>
                at 2000-09-05
17:20:59.0</TD></TR><TR><TH>BID_PRICE</TH><TH>BID_SIZE</TH><TH>ASK_PRICE</TH><TH>ASK_SIZE</TH></TR><TR><TD>40.50</TD><TD>100</TD><TD>40.70</TD><TD>200</TD></TR></TABLE><BR>Your
portfolio contains <B>1050</B> shares.
          
        </CENTER></BODY></HTML>

<!-- This page was served in 711 milliseconds by
Cocoon 1.7.4 -->


It is very unreadable and I would sometimes like to be
able to get more neaty result code.

TIA
Drasko

P.S.  I guess my email client will make it look even
more messy :-)


--- Drasko Kokic <dr...@yahoo.com> wrote:
> I am interested to see the source of a document I
> get
> in my browser in a more readable form.  I wonder if
> there is any way to influence how the final document
> is going to be "styled".  Changing xsl files make no
> difference :-(
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from
> anywhere!
> http://mail.yahoo.com/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> cocoon-users-help@xml.apache.org
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

Re: once again: formating output document

Posted by Jens Lorenz <je...@interface-business.de>.
----- Original Message -----
From: Drasko Kokic <dr...@yahoo.com>
To: <co...@xml.apache.org>
Sent: Tuesday, September 05, 2000 5:21 PM
Subject: once again: formating output document


> Hello there,
>
> It's hard to belive that no one could shed some light
> on this topic ... why the following XSL code:
>
>
>   <xsl:template match="STOCKINFO">
>     <xsl:processing-instruction
> name="cocoon-format">type="text/html"</xsl:processing-instruction>
>
>     <HTML>
>       <HEAD>
>         <TITLE><xsl:value-of select="TITLE"/></TITLE>
>       </HEAD>
>
>       <BODY bgcolor="#FFFFFF">
>         <CENTER>
>
>           <TABLE border="1" width="80%"
> cellpadding="4">
>             <TR>
>               <TD bgcolor="{$title-bg-color}"
> align="left" colspan="4" rowspan="1" valign="top">
>                 <BIG><BIG><xsl:value-of
> select="TITLE"/></BIG></BIG>
>                 at <xsl:value-of
> select="/STOCKINFO/SYSDATE/ROWSET/ROW/SYSDATE/."/>
>               </TD>
>             </TR>
>             <TR>
>               <TH>BID_PRICE</TH>
>               <TH>BID_SIZE</TH>
>               <TH>ASK_PRICE</TH>
>               <TH>ASK_SIZE</TH>
>             </TR>
>             <TR>
>               <TD><xsl:value-of
> select="STOCK//BID_PRICE"/></TD>
>               <TD><xsl:value-of
> select="STOCK//BID_SIZE"/></TD>
>               <TD><xsl:value-of
> select="STOCK//ASK_PRICE"/></TD>
>               <TD><xsl:value-of
> select="STOCK//ASK_SIZE"/></TD>
>             </TR>
>           </TABLE>
>
>           <BR/>Your portfolio contains
> <B><xsl:value-of select="TOTAL//QUANTITY"/></B>
> shares.
>
>         </CENTER>
>       </BODY>
>     </HTML>
>   </xsl:template>
>
>
> produces following HTML code:
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
> "http://www.w3.org/TR/REC-html40/strict.dtd">
> <HTML><HEAD><TITLE>Stock Information on
> INSP</TITLE></HEAD><BODY
> bgcolor="#FFFFFF"><CENTER><TABLE border="1"
> cellpadding="4"
> width="80%"><TR><TD align="left" bgcolor="#c0c0c0"
> colspan="4"
> rowspan="1" valign="top"><BIG><BIG>Stock Information
> on INSP</BIG></BIG>
>                 at 2000-09-05
>
17:20:59.0</TD></TR><TR><TH>BID_PRICE</TH><TH>BID_SIZE</TH><TH>ASK_PRICE</TH
><TH>ASK_SIZE</TH></TR><TR><TD>40.50</TD><TD>100</TD><TD>40.70</TD><TD>200</
TD></TR></TABLE><BR>Your
> portfolio contains <B>1050</B> shares.
>
>         </CENTER></BODY></HTML>
>
> <!-- This page was served in 711 milliseconds by
> Cocoon 1.7.4 -->
>
>
> It is very unreadable and I would sometimes like to be
> able to get more neaty result code.
>
> TIA
> Drasko
>
> P.S.  I guess my email client will make it look even
> more messy :-)
>

Well, to the browser it just doesn't matter ... In fact I have
an <xsl:strip-space elements="*"/> in every stylesheet of mine,
to make the html code shorter ...

If you want to have neat html code, why don't you postprocess
the code with some html formatter before you have a look at it ?

One example is HTML Tidy from w3c, but there are numerous ...
(http://www.w3.org/People/Raggett/tidy/)


Regards,

Jens

--

jens.lorenz@interface-business.de

interface:business GmbH                             \\|//
Tolkewitzer Strasse 49                              (o o)
01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
Germany



Re: once again: formating output document

Posted by Sylvain Wallez <wa...@free.fr>.
Try to put "formatter.text/xhtml.indent = 1" in cocoon.properties. This
tells the Cocoon formatter to use 1 space indenting. It works fine for
me with the text/html/loose formatter.

-Sylvain


Drasko Kokic a écrit :
> 
> Hello there,
> 
> It's hard to belive that no one could shed some light
> on this topic ... why the following XSL code:
> 
>   <xsl:template match="STOCKINFO">
>     <xsl:processing-instruction
> name="cocoon-format">type="text/html"</xsl:processing-instruction>
> 
>     <HTML>
>       <HEAD>
>         <TITLE><xsl:value-of select="TITLE"/></TITLE>
>       </HEAD>
> 
>       <BODY bgcolor="#FFFFFF">
>         <CENTER>
> 
>           <TABLE border="1" width="80%"
> cellpadding="4">
>             <TR>
>               <TD bgcolor="{$title-bg-color}"
> align="left" colspan="4" rowspan="1" valign="top">
>                 <BIG><BIG><xsl:value-of
> select="TITLE"/></BIG></BIG>
>                 at <xsl:value-of
> select="/STOCKINFO/SYSDATE/ROWSET/ROW/SYSDATE/."/>
>               </TD>
>             </TR>
>             <TR>
>               <TH>BID_PRICE</TH>
>               <TH>BID_SIZE</TH>
>               <TH>ASK_PRICE</TH>
>               <TH>ASK_SIZE</TH>
>             </TR>
>             <TR>
>               <TD><xsl:value-of
> select="STOCK//BID_PRICE"/></TD>
>               <TD><xsl:value-of
> select="STOCK//BID_SIZE"/></TD>
>               <TD><xsl:value-of
> select="STOCK//ASK_PRICE"/></TD>
>               <TD><xsl:value-of
> select="STOCK//ASK_SIZE"/></TD>
>             </TR>
>           </TABLE>
> 
>           <BR/>Your portfolio contains
> <B><xsl:value-of select="TOTAL//QUANTITY"/></B>
> shares.
> 
>         </CENTER>
>       </BODY>
>     </HTML>
>   </xsl:template>
> 
> produces following HTML code:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
> "http://www.w3.org/TR/REC-html40/strict.dtd">
> <HTML><HEAD><TITLE>Stock Information on
> INSP</TITLE></HEAD><BODY
> bgcolor="#FFFFFF"><CENTER><TABLE border="1"
> cellpadding="4"
> width="80%"><TR><TD align="left" bgcolor="#c0c0c0"
> colspan="4"
> rowspan="1" valign="top"><BIG><BIG>Stock Information
> on INSP</BIG></BIG>
>                 at 2000-09-05
> 17:20:59.0</TD></TR><TR><TH>BID_PRICE</TH><TH>BID_SIZE</TH><TH>ASK_PRICE</TH><TH>ASK_SIZE</TH></TR><TR><TD>40.50</TD><TD>100</TD><TD>40.70</TD><TD>200</TD></TR></TABLE><BR>Your
> portfolio contains <B>1050</B> shares.
> 
>         </CENTER></BODY></HTML>
> 
> <!-- This page was served in 711 milliseconds by
> Cocoon 1.7.4 -->
> 
> It is very unreadable and I would sometimes like to be
> able to get more neaty result code.
> 
> TIA
> Drasko
> 
> P.S.  I guess my email client will make it look even
> more messy :-)
> 
> --- Drasko Kokic <dr...@yahoo.com> wrote:
> > I am interested to see the source of a document I
> > get
> > in my browser in a more readable form.  I wonder if
> > there is any way to influence how the final document
> > is going to be "styled".  Changing xsl files make no
> > difference :-(
> >