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

Re: Namespace handling in XML Processors

  • From: "W. Eliot Kimber" <eliot@i...>
  • To: veda <m.vedachalam@t...>
  • Date: Tue, 31 Aug 1999 13:50:38 +0100

internal and external namespace
veda wrote:
> 
> Hai all....
> 
> Could someone tell me what is
> 
> internal subset, external subset, Namespaces in XML.
> Is there any website which discusses them and the XML terms in general.

An XML document consists of three parts, two of which must always be
explicitly present (the third is implicit if not provided):

1. The XML declaration: <?xml version="1.0"?>
2. The DOCTYPE declaration (which can be omitted)
3. The document instance (the tag stuff)

The DOCTYPE declaration declares the name of the root element (the
"document type") and declares the element types used in the instance. It
also contains declarations of any entities used by the document
(entities are either string macros or files (technically, abstract
storage objects).

Logically the DOCTYPE declaration is a flat list of element type,
attribute list, and entity declarations (and notation declarations, but
I haven't talked about those). Physically, the declaration can be
organized into two parts, one in the document's main file (the "document
entity", that is, the file that contains the XML declaration, the
DOCTYPE declaration (if there is one), and the root element) and one in
an external file.

Because these two parts of the DOCTYPE declaration make up the larger
whole, they are both subsets. The one inside the document is the
"internal" subset and the one outside the document is the "external"
subset.

A typical DOCTYPE declaration looks like this:

<!DOCTYPE foo SYSTEM "myexternalsubset.dtd" [
  <!-- This is the internal subset -->
  <!ELEMENT foo (#PCDATA) ><!-- Declaration of element type 'foo' -->
]>

The external subset is the file named by the filename following the
SYSTEM keyword. 

While logically there is no difference between the internal and external
subsets, XML defines slightly different rules for how the internal and
external subsets must be processed. This reflects common (although
misguided, IMNSHO) practice and makes things easier for processors that
don't do validation and therefore don't need to process the
declarations.

One key rule about internal and external subsets is that the internal
subset is always parsed *before* the external subset, which means that
any entities declared in the internal subset will take precedence over
entities with the same name declared in the external subset. This allows
a weak form of modularization of declaration sets: external DTD subsets
can provide entities that are intended to be redeclared in internal
subsets. 

Cheers,

E.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



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.