HighTechTalks DotNet Forums  

XSLT Plain Text is Indented

Dotnet XML microsoft.public.dotnet.xml


Discuss XSLT Plain Text is Indented in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Spam Catcher
 
Posts: n/a

Default XSLT Plain Text is Indented - 11-09-2007 , 02:02 AM






Hi All,

I'm having some trouble getting my XSLT to transform correctly.

VS.NET addeds Indentations:

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="text" indent="no" />
<xslaram name="Name"/>
<xsl:template match="/">
Hello <xsl:value-of select="$Name" />,

We have received your e-mail, and your question is in the process of
being routed to the appropriate department. Our customer service
representatives will make every effort to respond to your message within
24 hours. In the meantime, if you have not already done so, please take
a moment to look for your answer in the frequently asked questions (FAQ)
section of our site.

Thank you for taking the time to contact us. We value your opinions
and appreciate your concerns. A customer service representative will be
contacting you soon.

Sincerely,

MySite.com
</xsl:template>
</xsl:stylesheet>

The output looks like:

Hello SomeName,

We have received your e-mail, and your question is in the process of
being routed to the appropriate department. Our customer service
representatives will make every effort to respond to your message within
24 hours. In the meantime, if you have not already done so, please take
a moment to look for your answer in the frequently asked questions (FAQ)
section of our site.

Thank you for taking the time to contact us. We value your opinions
and appreciate your concerns. A customer service representative will be
contacting you soon.

Sincerely,

MySite.com

But I want the output to look like:

Hello SomeName,

We have received your e-mail, and your question is in the process of
being routed to the appropriate department. Our customer service
representatives will make every effort to respond to your message within
24 hours. In the meantime, if you have not already done so, please take
a moment to look for your answer in the frequently asked questions (FAQ)
section of our site.

Thank you for taking the time to contact us. We value your opinions and
appreciate your concerns. A customer service representative will be
contacting you soon.

Sincerely,

MySite.com

No indentation ... Is there anyway to do this?

Thanks!

Reply With Quote
  #2  
Old   
Martin Honnen
 
Posts: n/a

Default Re: XSLT Plain Text is Indented - 11-09-2007 , 08:23 AM






Spam Catcher wrote:
Quote:
Hi All,

I'm having some trouble getting my XSLT to transform correctly.

VS.NET addeds Indentations:

?xml version="1.0" encoding="utf-8" ?
xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xslutput method="text" indent="no" /
xslaram name="Name"/
xsl:template match="/"
Hello <xsl:value-of select="$Name" />,

We have received your e-mail, and your question is in the process of
being routed to the appropriate department. Our customer service
representatives will make every effort to respond to your message within
24 hours. In the meantime, if you have not already done so, please take
a moment to look for your answer in the frequently asked questions (FAQ)
section of our site.

Thank you for taking the time to contact us. We value your opinions
and appreciate your concerns. A customer service representative will be
contacting you soon.

Sincerely,

MySite.com
/xsl:template
/xsl:stylesheet

The output looks like:

Hello SomeName,

We have received your e-mail, and your question is in the process of
being routed to the appropriate department. Our customer service
representatives will make every effort to respond to your message within
24 hours. In the meantime, if you have not already done so, please take
a moment to look for your answer in the frequently asked questions (FAQ)
section of our site.

Thank you for taking the time to contact us. We value your opinions
and appreciate your concerns. A customer service representative will be
contacting you soon.

Sincerely,

MySite.com

But I want the output to look like:

Hello SomeName,

We have received your e-mail, and your question is in the process of
being routed to the appropriate department. Our customer service
representatives will make every effort to respond to your message within
24 hours. In the meantime, if you have not already done so, please take
a moment to look for your answer in the frequently asked questions (FAQ)
section of our site.

Thank you for taking the time to contact us. We value your opinions and
appreciate your concerns. A customer service representative will be
contacting you soon.

Sincerely,

MySite.com

No indentation ... Is there anyway to do this?
Well you have that indentation literally in the stylesheet so you could
change the stylesheet, simply put the text there without indentation.

Or use xsl:text to mark up your text e.g.

<xsl:template match="/">
<xsl:text>Hello </xsl:text>
<xsl:value-of select="$Name"/>
<xsl:text>,

We have received ...
</xsl:text>




--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.