XML/XSL/HTML Suppressing whitespace

Discussion in 'XML' started by tconti@hotmail.com, Jul 18, 2005.

  1. Guest

    Hello:

    I have written an application that generates emails using xsl in .Net.
    This is a port of functionality that reads some email text chunks from
    a DB and slaps them together. I have noticed that the emails that are
    generated from the style sheet are larger than using the DB method. I
    have tried a bunch of things. I tried setting indent to "NO" and I
    hacked extraneous whitespace from the stylesheet. I had some success
    controlling the document size using xml:space="default" and
    xml:space="preserve", but I still think I could cut the size of the
    email further.

    Does anyone have any thoughts on how I can suppress the extraneous
    whitespace that seems to get added from the XSL transform.

    Thanks,
    Tom
    , Jul 18, 2005
    #1
    1. Advertising


  2. > Does anyone have any thoughts on how I can suppress the extraneous
    > whitespace that seems to get added from the XSL transform.


    If you have indent set to no on xsl:eek:utput (which will be teh default
    anyway for xml output) then any white space in your result will be
    either copied from the source file or generated within the stylesheet,
    xslt never generates any white space in the result tree automatically.
    So without seeing a small test file hard to guess, although I could
    guess adding
    <xsl:strip-space elements="*"/> might do something useful (or,
    depending on your input, it might do some harm)

    David
    David Carlisle, Jul 18, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oli Filth
    Replies:
    9
    Views:
    3,307
    Uncle Pirate
    Jan 17, 2005
  2. Replies:
    2
    Views:
    845
  3. Replies:
    1
    Views:
    3,565
    A. Bolmarcich
    May 27, 2005
  4. Replies:
    10
    Views:
    705
    Eric Brunel
    Dec 16, 2008
  5. MRAB
    Replies:
    3
    Views:
    363
Loading...

Share This Page