SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question issue with inserting carraige return

    I have a similar issue, I have an excerpt from the mail template on an existing platform that someone else designed, basically I need the sections in the mail <body> line to be on seperate lines, I have tried everything I have been able to find via a google search but to no evail, any help would be much appreciated:

    <?xml version = '1.0' encoding = 'UTF-8'?>
    <MailTemplate>
    <EventMapping source="LAM" category="QAI" type="01" description="Metadata File Approved">
    <Condition>
    <ErrorDetail key="MVT_ERROR_TYPE">VERSION</ErrorDetail>
    <ErrorDetail key="MVT_ERROR_TYPE2">VERSION2</ErrorDetail>
    </Condition>
    <SendToAdmin>false</SendToAdmin>
    <SendToContentProvider>true</SendToContentProvider>
    <Title>QA Auto Approved Asset : [$ASSET_NAME$]</Title>
    <Body>Asset : [$ASSET_NAME$]<br />Provider : [$CONTENT_PROVIDER$]<br />ITV Filename : [$ITV_FILE_NAME$]<br />Approved at : $TIME$</Body>
    <NeedSendMail>true</NeedSendMail>

    So, I would want the Asset : [$ASSET_NAME$] on one line, then Provider : [$CONTENT_PROVIDER$] on the next line, etc. I already added in the <br/> but all this does is display the first section then nothing else on the line.
    Any ideas?

    Thanks in advance.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by thebeast1234 View Post
    Any ideas?.
    You would need to look at how that particular XML document is defined in order to determine what tags are valid and whether new lines are allowed and if so how to identify them. That is neither plain text nor HTML so \n and <br> are unlikely to be the solution.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,625
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You might want to try escaping the tags in your line break tags if the email is HTML.

    If not, just put a carriage return in where you want it -- XML should honor whitespace inside of tags.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •