Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - How to put ampersand into string

How to put ampersand into string

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How to put ampersand into string

Postby konic » Wed Sep 30, 2009 1:51 pm

The question is simple but yet I don't know the answer.
The following line returns error:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <string name="prices">PRICES & TAXES</string>
  2.  
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

because of the ampersand sign inside the string.
However the following line in code
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. someBtn.setText("PRICES & TAXES");
  2.  
Parsed in 0.020 seconds, using GeSHi 1.0.8.4

compiles just fine.
So, is there any way to insert ampersand into string in XML file?
konic
Developer
Developer
 
Posts: 32
Joined: Mon Aug 24, 2009 3:16 pm

Top

Postby azraeal » Wed Sep 30, 2009 6:39 pm

It's xml, so
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. &
Parsed in 0.000 seconds, using GeSHi 1.0.8.4
is probably escaped as
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. &amp;
Parsed in 0.000 seconds, using GeSHi 1.0.8.4
azraeal
Experienced Developer
Experienced Developer
 
Posts: 71
Joined: Fri Sep 04, 2009 6:34 pm
Location: California

Postby konic » Wed Sep 30, 2009 9:09 pm

azraeal wrote:It's xml, so ...
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. &amp;
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

Damn, I missed that ";" !
Thanks.
konic
Developer
Developer
 
Posts: 32
Joined: Mon Aug 24, 2009 3:16 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 3 guests