Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP MarkUp containing & character(MarkUp does not support & ampersand character)
RAP MarkUp containing & character [message #1239478] Tue, 04 February 2014 09:38 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 198
Registered: November 2012
Location: UK
Senior Member
Setting a Label with value:
<a href='http://www.iet.co.uk?a=1&b=2' target='_blank'>IET Classic Planes Ltd</a>
...and MarkUp in RAP causes a crash because of the & ampersand character:

java.lang.IllegalArgumentException: Failed to parse markup text
at org.eclipse.swt.internal.widgets.MarkupValidator.validate(MarkupValidator.java:60)
...
caused by:
...
org.xml.sax.SAXParseException: The reference to entity "b" must end with the ';' delimiter.
...


---
Just because you can doesn't mean you should
Re: RAP MarkUp containing &amp; character [message #1239492 is a reply to message #1239478] Tue, 04 February 2014 09:56 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1296
Registered: July 2009
Senior Member

RAP is a bit picky about well-formed XML. But actually, it's right, the
ampersand needs to be encoded in the URL to be a valid attribute value.

"http://www.iet.co.uk?a=1&b=2"
"http://www.iet.co.uk?a=1&amp;b=2"

HTH, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP MarkUp containing &amp; character [message #1239499 is a reply to message #1239492] Tue, 04 February 2014 10:14 Go to previous message
John Gymer is currently offline John GymerFriend
Messages: 198
Registered: November 2012
Location: UK
Senior Member
Thanks Ralf, I should have thought of that, as we are already doing it when creating out XML!
It means that our XML has 2-levels of the &amp; format:

<stdstx>&lt;a href=&apos;http://www.iet.co.uk?a=1&amp;amp;b=2&apos; target=&apos;_blank&apos;&gt;IET Classic Planes Ltd&lt;/a&gt;</stdstx>

Looks odd, but makes sense - thanks for your help!
John


---
Just because you can doesn't mean you should
Previous Topic:[ANN] RAP 2.3 M1 is available
Next Topic:two questions about custom widget?
Goto Forum:
  


Current Time: Mon Dec 22 13:38:32 GMT 2014

Powered by FUDForum. Page generated in 0.01570 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software