How to represent space and tab in XML tag. Is there any special characters for them to represent.
I think you could use an actual space or tab directly in XML document, but if you are looking for special characters to represent them so that text processors can't mess them up, then it's:
space =  
tab = 	
I had the same issue and none of the above answers solved the problem, so I tried something very straight-forward: I just putted in my strings.xml
\n\t
The complete String looks like this <string name="premium_features_listing_3">- Automatische Aktualisierung der\n\tDatenbank</string>
Results in:
Automatische Aktualisierung der
Datenbank
(with no extra line in between)
Maybe it will help others. Regards
Work for me
\n = 

\r = 
\t = 	
space =  
Here is an example on how to use them in XML
<KeyWord name="hello	" />
For me, to make it work I need to encode hex value of space within CDATA xml element, so that post parsing it adds up just as in the htm webgae & when viewed in browser just displays a space!. ( all above ideas & answers are useful )
<my-xml-element><![CDATA[ ]]></my-xml-element>
You cannot have spaces and tabs in the tag (i.e., name) of an XML elements, see the specs: http://www.w3.org/TR/REC-xml/#NT-STag. Beside alphanumeric characters, colon, underscore, dash and dot characters are allowed in a name, and the first letter cannot be a dash or a dot. Certain unicode characters are also permitted, without actually double-checking, I'd say that these are international letters.
New, expanded answer to an old, commonly asked question...
Summary: Whitespace characters are not permitted in XML element or attribute names.
Here are the main Unicode code points related to whitespace:
#x0009
CHARACTER TABULATION#x0020
SPACE#x000A
LINE FEED (LF)#x000D
CARRIAGE RETURN (CR)#x00A0
NO-BREAK SPACE[#x2002-#x200A]
EN SPACE through HAIR SPACE#x205F
MEDIUM MATHEMATICAL SPACE#x3000
IDEOGRAPHIC SPACENone of these code points are permitted by the W3C XML BNF for XML names:
NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] Name ::= NameStartChar (NameChar)*
Summary: Whitespace characters are, of course, permitted in XML content.
All of the above whitespace codepoints are permitted in XML content by the W3C XML BNF for Char:
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */
Unicode code points can be inserted as character references. Both decimal &#
decimal;
and hexadecimal &#x
hex;
forms are supported.
	
or 	
CHARACTER TABULATION

or
LINE FEED (LF)
or
CARRIAGE RETURN (CR) 
or  
SPACE 
or  
NO-BREAK SPACE