Textview class: how can write a „&“ ?

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
root
Posts: 15
Joined: Sun Feb 14, 2010 12:24 pm

Textview class: how can write a „&“ ?

Post by root »

Hi guys!
I have a problem when i try to write the & symbol in the textview class!
Error: Error parsing XML: not well-formed (invalid token)

SamuraiCrow
Posts: 311
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Textview class: how can write a „&“ ?

Post by SamuraiCrow »

There are five special characters in xml that require special codes to render. The code for ampersand is "& amp ;" with the spaces and quotes removed.

Source: http://xml.silmaril.ie/specials.html
I'm on registered MorphOS using FlowStudio.

User avatar
root
Posts: 15
Joined: Sun Feb 14, 2010 12:24 pm

Re: Textview class: how can write a „&“ ?

Post by root »

ok - thanks!

But when i use & in the Hollywoodapp is see always two & signs (&&)??

User avatar
airsoftsoftwair
Posts: 4320
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Textview class: how can write a „&“ ?

Post by airsoftsoftwair »

What do you mean by "in the Hollywood app"?

Bugala
Posts: 919
Joined: Sun Feb 14, 2010 7:11 pm

Re: Textview class: how can write a „&“ ?

Post by Bugala »

are you looking for this:

Code: Select all

text = "to use \"quote\""
TextOut(100, 100, text)
WaitRightMouse() 
This "\" can be used for others too.

User avatar
root
Posts: 15
Joined: Sun Feb 14, 2010 12:24 pm

Re: Textview class: how can write a „&“ ?

Post by root »

OK
Here is a little code to demonstrate the "double sign bug???"

Code: Select all

@REQUIRE "RapaGUI"
xml = [[
<?xml version="1.0" encoding="iso-8859-1"?>
<application>
<window title="Textview example">
<vgroup>
<textview>

		Hello &amp; World
		
</textview>
</vgroup>
</window>
</application>
]]
moai.CreateApp(xml)
Repeat
WaitEvent
Forever
And here the result is a double & sign

Image

User avatar
jPV
Posts: 364
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Textview class: how can write a „&“ ?

Post by jPV »

On MorphOS I only get one & character with that example... so it must be a platform dependant bug...

User avatar
airsoftsoftwair
Posts: 4320
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Textview class: how can write a „&“ ?

Post by airsoftsoftwair »

Actually, with my WIP version of RapaGUI 2.0 the code posted by root works fine on Windows too. So I think this has been fixed already...

Post Reply