[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: escaping characters

  • From: Michael Brennan <Michael_Brennan@A...>
  • To: 'James Gray' <james.gray@b...>, xml-dev@l...
  • Date: Wed, 20 Dec 2000 12:42:10 -0800

xml escaping characters
Colons are perfectly legal. A colon within an element name (as Mike Brown
mentioned) is used to separate a namespace prefix from the local element
name. A parser that is namespace aware should handle this just fine. A
parser that is not namespace aware should just treat it as part of the
element name and pass it through to the application. If your parser is
having problems with a colon, then there is a problem with the parser.

There are standard ways of escaping special characters (outlined in the XML
1.0 spec at http://www.w3.org/TR/2000/REC-xml-20001006). The ampersand is a
special character that is used to denote the start of an escaped special
character. A literal ampersand within attribute or element content must
itself be escaped as "&amp;". If an ampersand appears within the content,
and that ampersand is not the start of a valid token representing an escaped
special character, then the XML is invalid and a properly implemented parser
(if it recognizes this case) will raise an error. For example, if the
document contains something like "<ice-cream-brand>Ben &
Jerry's</ice-cream-brand>", that would be invalid XML. But
"<ice-cream-brand>Ben &amp; Jerry's</ice-cream-brand>" would be legal, and
an XML parser would return the string "Ben & Jerry's" to the application as
the element content.

> -----Original Message-----
> From: James Gray [mailto:james.gray@b...]
> Sent: Wednesday, December 20, 2000 10:35 AM
> To: xml-dev@l...
> Subject: RE: escaping characters
> 
> 
> 
> The parser is giving me a generic error -- nothing specific
> enough to debug.  If the ':' is special, how would I escape
> it?  Different parsers escape certain characters differently,
> correct?
 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.