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

Re: 3 basic XML questions on: non-determism, reserved symbols,and xml:la

  • From: Richard Tobin <richard@c...>
  • To: xml-dev@l...
  • Date: Wed, 23 May 2001 17:46:07 +0100 (BST)

xml escape symbols
> Can someone
> please clarify what it means that non-deterministic content models are
> not allowed in XML?

It's "an error" (rather than a validity or well-formedness error),
which means that parsers are not required to detect it.  So the
parsers you mention are not wrong, just not as good as they might be.

> [2] It was also my understanding that the following symbols are
> "reserved", and may not be used in an instance document's data:

>     <  >  &  "  '

> Instead, the "escaped" version must be used:

>   &lt;  &gt;  &amp;  &quot;  &apos;

> However, my experience is that XML Parsers do not require >, ", or ' to
> be escaped.  Can someone please clarify what are the "reserved"
> symbols?  When do I need to escape >, ", and '?

You always need to escape &, because it would otherwise be interpreted
as an entity reference.  You always need to escape <, because in content
it would be interpreted as a start tag and in an attribute it's just
illegal (for historical reasons, I think).  Quotes need only be
escaped in contexts where they would otherwise be misinterpreted
(i.e. inside strings quoted with the same kind of quote).  > never
needs to be escaped; &gt; is just for symmetry.

> However, I have found that
> whenever xml:lang is used on an element it must be declared in the DTD. 

Yes, if you want the document to be valid.  If you don't care about
validation - you're happy with well-formedness - you don't have to
declare it.

-- Richard

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-2011 All Rights Reserved.