Sybase ASA Char (39) Single quote
Char (34) Double quote
For example, the variable @k caused by writing: char (+@k+char) ————————————————————
2007-07-31 22:36
using double quotes in XML
<add key = "Test" value= ""fdfdfdsfsfgsfg","sdadfa""/>
Text is composed of character data and tags. Tags include start tags, end tags, empty element tags, entity references, character references, comments, CDATA segment delimiters, document type declarations, and processing instructions.
All other unlabeled text makes up the character data for the document.
The ampersand (&) and the left angle bracket (<) can appear literally only as a token delimiter, or in comments, processing instructions, or CDATA segments. They are also valid in the literal entity values of an internal entity declaration, see "4.3.2 Well-Formed parsing entity." If the two characters need to be used elsewhere, they must be escaped with a numeric character reference or be represented by a string of "&" and "<" respectively. The right angle bracket (>) can be represented by ">" and when it appears in the string "]]>" in the content, but this string does not represent the end of a CDATA segment, it must be escaped with ">" or a character reference for compatibility reasons.
In the contents of an element, the character data can be any string that does not include the starting delimiter of any tag. In a CDATA segment, the character data can be any string that does not include the CDATA segment end delimiter "]]>".
To allow single and double quotes to be included in the attribute value, the ellipsis or single quotation mark (') can be represented as "'", and double quotes (") can be represented as" " ".
Character data
[A] Chardata:: = [^<&]*-([^<&]* ']]> ' [^<&]*]
use of —————————————————————————————— T-SQL single quotes (2012-07-02-17:26:48) reprint
Tags: topics |
Category: Database theory |
Use TEST
Go
IF object_id (' tempdb.. #t ') is not NULL
DROP TABLE #t
Go
CREATE TABLE #T
(ID INT IDENTITY (1,1),
TT NVARCHAR (10)
)
SET QUOTED_IDENTIFIER ON
INSERT into #T (TT) VALUES (' Aa+aa ')
INSERT into #T (TT) VALUES (' AA ' ' AA ')
INSERT into #T (TT) VALUES ("Aa+aa")
--Message 207, Level 16, State 1, line 4th
--The column name ' AA+AA ' is invalid.
SELECT * FROM #T
SET QUOTED_IDENTIFIER OFF
INSERT into #T (TT) VALUES ("Aa1+aa1")
INSERT into #T (TT) VALUES ("AA1 ' AA1")
INSERT into #T (TT) VALUES (' Aa2+aa2 ')
SELECT * FROM #T
The above is transferred from: http://www.haogongju.net/art/1481200
—————————————————————— XML Special Character processing
In XML, there are symbols for XML, and in some cases attribute values must be marked with these special symbols. The following is mainly to explain some common special symbols of the processing
Example one: The use of double quotes.
Double quotes are the starting end symbol for XML property values, so you cannot use "" directly in the value. Processing can be divided into two types.
A: There is no ' (single quote) in the property value, so you can use single quotes ' as the starting end symbol for the property value
<add key= "IPhone" value= "apple"/> ... The property value is ("Apple").
FIX: <add key= "IPhone" value= ' Apple '/>
B: There are ' (single quotes) and double quotes in the attribute value. Such as... The property value is (' Apple ').
<add key= "IPhone" value= ""'apple"" />
The following table lists five built-in entities for the characters used by XML tags.
Entity |
Entity references |
meaning |
Lt |
< |
< (less than number) |
Gt |
> |
> (greater than Number) |
Amp |
& |
& ("and" characters) |
APOs |
' |
' (apostrophes or single quotes) |
quot |
" |
"(double quotes) |
If the character may cause the XML parser to interpret the document structure incorrectly, use the entity instead of typing a character. ' and " Entity references are most commonly used in attribute values.