XSLT Plain Text is Indented

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spam Catcher

    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:styleshe et 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!
  • Martin Honnen

    #2
    Re: XSLT Plain Text is Indented

    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:styleshe et 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>Hel lo </xsl:text>
    <xsl:value-of select="$Name"/>
    <xsl:text>,

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




    --

    Martin Honnen --- MVP XML

    Comment

    Working...