[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: Mike Brown <mike@s...>
  • To: "Roger L. Costello" <costello@m...>
  • Date: Wed, 23 May 2001 10:49:46 -0600 (MDT)

xml reserved symbols
> [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;

"<" and "&" must be escaped when they are character data, not markup.

">" must be escaped when it follows "]]" and is character data, not markup
indicating the end of a CDATA section. This is supposedly for (SGML?)
compatibility only. ">" is often escaped even though it doesn't need to
be, for the benefit of human document authors and readers. 

A machine can easily tell when ">" is markup or not, but our eyes aren't
quite so good at it. For example, there's nothing wrong with this, but
doesn't it look kinda kooky? <a href="foo">"foo">></a> ... much easier
when it's <a href="foo">"foo"&gt;&gt;</a>

Quotes need only be escaped when in attribute values that are delimited by 
the same kind of quotes.

This info is in the XML spec and is one of the less obtuse portions; you 
could have gotten the info there.

> [3] The purpose of xml:lang is to indicate the language of the contents
> of an element.  It was my understanding that xml:lang is a "standard"
> attribute that may be used on any element.  However, I have found that
> whenever xml:lang is used on an element it must be declared in the DTD. 
> How can it be "standard" if it has to be declared?  I guess that
> "standard" does not mean "built-in"?

Again, this is in the spec. It outright says that it must be declared.
I think looking up this info there is probably easier than observing the 
behavior of parsers, especially since the parsers may even be buggy.

   - Mike
_____________________________________________________________________________
mike j. brown, software engineer at  |  xml/xslt: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal: http://hyperreal.org/~mike/

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.