SYBASE and tidy up some single quotes and double quote questions:

Source: Internet
Author: User
Tags cdata sybase tidy xml parser
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= "&quot;fdfdfdsfsfgsfg&quot;,&quot;sdadfa&quot;"/>

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 "&amp;" and "&lt;" respectively. The right angle bracket (>) can be represented by "&gt;" 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 "&gt;" 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 "&apos;", and double quotes (") can be represented as" &quot; ".

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= "&quot;&apos;apple&quot;" />

The following table lists five built-in entities for the characters used by XML tags.

Entity Entity references meaning

Lt

&lt;

< (less than number)

Gt

&gt;

> (greater than Number)

Amp

&amp;

& ("and" characters)

APOs

&apos;

' (apostrophes or single quotes)

quot

&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. &apos; and &quot; Entity references are most commonly used in attribute values.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.