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 » Wed Mar 25, 2020 8:39 pm

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: 248
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

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

Post by SamuraiCrow » Thu Mar 26, 2020 2:46 am

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

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

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

Post by root » Thu Mar 26, 2020 5:51 pm

ok - thanks!

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

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

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

Post by airsoftsoftwair » Sat Mar 28, 2020 12:31 pm

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

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

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

Post by Bugala » Sat Mar 28, 2020 1:43 pm

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 » Sat Mar 28, 2020 2:13 pm

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: 315
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

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

Post by jPV » Sun Mar 29, 2020 6:02 pm

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

Post Reply