473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XSLT Plain Text is Indented

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">
<xsl:output method="text" indent="no" />
<xsl:param 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!
Nov 9 '07 #1
1 3704
Spam Catcher wrote:
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">
<xsl:output method="text" indent="no" />
<xsl:param 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/
Nov 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
3
by: Ndeye | last post by:
Hi all I have this xml file (generated from Lotus Domino 6) and would like to transform it to a simpler one by extracting only data between the gif tag (I cut the gif data to reduce the file...
3
by: Gordon Moore | last post by:
Hi, I'm new to using xml/xslt and although I can create an xml document using the dataset.WriteXml statement, and I have created an xslt to transform the xml into the output I want, I have to...
3
by: Andy | last post by:
Hi all, I'm having a problem doing an Xslt transform in code. I've done it before, so I'm not really sure why its not working. The problem is that the result of the transform is an empty...
1
by: tconti | last post by:
Howdy: I have 2 general questions regarding the use of XSLT to generate emails. We have several procecesses that use XSLT to generate emails. We frequently run into issues where a client...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
4
by: WStoreyII | last post by:
I wish to know how to set it up so that when an xml webservice is called that instead of displaying the xml in the browser it will render it with a xslt file the problem is i dont know how to do...
3
by: realmerl | last post by:
Hi All. I'm trying to transform a html document into plain text via xslt. Simple you say! (i hope) I have got it working, by using the magnificent <xsl:value-of select="."/>. This returns the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.