Login 
 
 Pref   Your subscriptions   Home   Help 
users@ml.mod-xslt2.com
mod-xslt2 - Users Mailing List
   
 
List info
 
 
 
Subscribe
 
 
Unsubscribe
 
 
Archive
 
 
Post
 



Advanced search
2004 01 02 03 04 05 06 07 08 09 10 11 12
2005 01 02 03 04 05 06 07 08 09 10 11 12
2006 01 02 03 04 05 06 07 08 09 10 11 12
2007 01 02 03 04 05 06 07 08 09 10 11 12
2008 01 02 03 04 05 06 07 08 09 10 11 12
2010 01 02 03 04 05 06 07 08 09 10 11 12
2011 01 02 03 04 05 06 07 08 09 10 11 12

  previous   Chronological   next       previous   Thread   next  

Re: [mod-xslt users] End comment in output Carlo Contavalli
  • From: Carlo Contavalli <ccontavalli@xxxxxxxxxxx>
  • To: users@xxxxxxxxxxxxxxxx
  • Subject: Re: [mod-xslt users] End comment in output
  • Date: Fri, 6 May 2005 10:25:53 +0200
  • References: <E1DTxfz-0006ev-00@relay.mixmail.com>


  • On Fri, May 06, 2005 at 08:55:11AM +0100, eps com estem wrote:
    > Yes, the presence of the credits is an important issue. One basic thing in
    > internet pages
    > (not intranet ones) is speed and speed means reduce at the maximum the size
    > of documents
    > that are going to be sent.
    > The "credits" presence is a bad thing, not for the publicity (which is
    > acceptable) but for
    > the extra bandwidth you spend.
    ok :), see previous mail. You can disable it at compile time. It would
    probably be better to make it a run time option, though.

    > And another problem is the inexistent control of the html output. I mean,
    > the code
    >
    > -html-
    > -body-
    > hello
    > -a href="aaa" link -/a
    >
    > should be without breaklines/white spaces/etc
    >
    > -html--body-hello-a href="aaa" link -/a
    >
    > This makes a difference if you do in all the pages, but i think there is no
    > option to
    > control it in the mod-xslt module.
    ok, this is a much more delicate issue. XML and XSL are very strict in
    dictating which spaces should be preserved or stripped during
    transformations. Breaking those rules, means breaking standard
    compliance.

    And mod-xslt removing spaces may not always be the correct choice: I
    believe some browsers may display a document differently depending on
    the presence/absency of deemed useless spaces.

    The behavior in respect to whitespaces and XML/XSL is very well
    defined, as indicated in the http://www.w3.org/TR/xslt specifications.
    You have some control of it in your XSL by using:

    <xsl:strip-space elements="tokens" />
    <xsl:preserve-space elements="tokens" />

    something like
    <xsl:strip-space elements="*" />
    right after your
    <xsl:stylesheet>
    directive may help.

    You can also use the:
    <element xml:space="preserve|default" ...>
    as an attribute of your xml elements.

    Additionally, the following may also help:
    XPath function -- normalize-space(string)
    removes leading and trailing spaces from
    anything that can be converted to a string
    indent attribute of <xsl:output element
    <xsl:output indent="no" ... will remove
    many ``useless'' \n, \r and leading spaces.

    Hope it helps,
    Cheers,
    Carlo

    --
    GPG Fingerprint: 2383 7B14 4D08 53A4 2C1A CA29 9E98 5431 1A68 6975
    -------------
    What about WRITING it first and rationalizing it afterwords? :-)
    -- Larry Wall in <8162@xxxxxxxxxxxxxxxxxxxxxxx>

      Powered by Sympa