Jump to:

23373 Posts in 18175 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » Problems when Content has an ampersand (&)

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1398 Views
  • headless_pnub
    Avatar
    Community Member
    17 Posts

    Problems when Content has an ampersand (&) Link to this post

    Hi all,

    I'm having a problem whenever my client uses an & in the content of a post I get a Parsing error like to one below.

    XML Parsing Error: not well-formed
    Location: http://www.xxxxxxxxxx.co.uk/
    Line Number 217, Column 48:Text containing an & some where
    -------------------------------------------^

    Does anyone have any ideas of how I can fix this?
    Any help greatly appreciated.

    Pnub

  • Romeo
    Avatar
    Community Member
    67 Posts

    Re: Problems when Content has an ampersand (&) Link to this post

    I think you have to be a little more specific about the nature of the page in question. Is it a form? The broswer would normally escape any ampersands in the form data, so this is a little puzzling.

  • headless_pnub
    Avatar
    Community Member
    17 Posts

    Re: Problems when Content has an ampersand (&) Link to this post

    No, it's not a form, it's just in an ArticlePage.

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Problems when Content has an ampersand (&) Link to this post

    This is a content issue being thrown by your browser (not SilverStripe), your page is being generated with an XHTML doctype but the content being generated isn't fully compliant. It should be outputting the html entity instead of a raw ampersand

    &

    not

    &

    Firefox 3.5 and IE 8 will both choke on this. You need to fix the markup or change your doctype to HTML transitional, unless anyone has a better solution?

    1398 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.