XML/XSL/HTML Suppressing whitespace

T

tconti

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
 
D

David Carlisle

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top