Why the chaper 4 is titled as "Physical Structures" in XML v4

S

SutterCreek

Help needed,

In Extensible Markup Language (XML) 1.0 (Fourth Edition), chaper 4 is
titled as "Physical Structures".

[Definition: An XML document may consist of one or many storage units.
These are called entities; they all have content and are all (except
for the document entity and the external DTD subset) identified by
entity name.] Each XML document has one entity called the document
entity, which serves as the starting point for the XML processor and
may contain the whole document.

I am very confused by the title.

This whole chapter is talking about entity.

I have some question.

For example,

<books><book><title>how to ...</title></book></books>

Is books a entity? is book, title a entity? is 'how to...' a entity?
If they are, what are the Entity References for them?

If not, ok, what is the storage layout of them?

If the whole chaper is only talking about the entity, how can you put
the "phisical structures" as the title?

Thanks in advance.
 
R

Richard Tobin

SutterCreek said:
For example,

<books><book><title>how to ...</title></book></books>

Is books a entity? is book, title a entity? is 'how to...' a entity?

No, <book> and <title> are elements. "how to ..." is some text.

External entities are the files that make up a document, including
the document file itself. They are idenitified by URLs.

Internal entities are named bits of text, such as the amp entity,
which is referenced as "&amp;" and expands to an ampersand character.
Usually they just contain plain text, but they can also contain
elements. They're often used for things which are hard to type
(e.g. non-ascii characters) and standard bits of text (e.g. copyright
notices).
If the whole chaper is only talking about the entity, how can you put
the "phisical structures" as the title?

Entities are the physical structure of an XML document - they contain
the characters it is made of. Contrast with logical structure, which
is the division into elements.

-- Richard
 
A

Andy Dingley

This whole chapter is talking about entity.

Ignore entities for the moment. They're not something you need to use
immediately, until you have some experience with XML.

In the short term, you'll encounter character references like  
and references to the predefined entities &amp;, &lt;, &gt;, &apos; &
&quot;
These are simpler, only refer to one character and they're already
defined for you to use. This much is easy. Defining your own entities
is more complex and rarely needed.

<books><book><title>how to ...</title></book></books>

Is books a entity?

No, it's an element. It's an element that contains a child element
called <book>. It has a start tag of "<books>" and an end tag of "</
books>". It's descendant element "<title>" also has some text content
as its child.

In the context of everyday work with XML, you'd refer to books as an
_element_. That's the level you work with.

In the broader scope it's correct to say that if the fragment you
quote was the whole document, then that would indeed be correctly
described as an "entity". This is really obscure though (I'm not even
sure if it's accurate!) -- entities aren't often used, they're even
more rarely defined from scratch, and it's normal that the terms are
only used when we're assembling compound documents from multiple
entities. Although I think it's correct to say that all documents do
contain at least one entity, we don't discuss them in that way until
there are multiple entities in use.

Entities were a fairly common feature used in SGML work. For XML,
they're rare (apart from the handful of pre-defined characters).
 
S

SutterCreek

As it is said:
An XML document may consist of one or many storage units.
These are called entities

Now in my example:
<books><book><title>how to ...</title></book></books>

books is not entities, neither book, title, how to....

if the title is "Physical Structures" (of the xml document),
so, what is the Physical Structures of books, book, title, how to....

if only talk about the entity whatever, why not just put the "Entity"
as the title?

It's just like when you talk about the physical structure of a human
being, but you only talk about the physical structure of a leg, is
that something very accurate?

While, maybe I am wrong.

Thanks though!
 
R

Richard Tobin

SutterCreek said:
Now in my example:
<books><book><title>how to ...</title></book></books>

books is not entities, neither book, title, how to....

if the title is "Physical Structures" (of the xml document),
so, what is the Physical Structures of books, book, title, how to....

That's like asking what the physical structure of The Lord of the Rings
is. You can't tell from the text, you need the actual book(s). It
might be in one volume, it might be in three.

If you have a file containing exactly the text shown, then the
physical structure is simple. It's a single entity.
if only talk about the entity whatever, why not just put the "Entity"
as the title?

It's called "Physical Structures" to distinguish it from the previous
section, which is called "Logical Structures".

"Entities" is the answer to the question "what are the physical
structures of an xml document", just as "elements and attributes" is
the answer to "what are the logical structures of an xml document".

-- Richard
 
J

Joseph Kesselman

SutterCreek said:
As it is said:
An XML document may consist of one or many storage units.
These are called entities

Read "storage units" as "files", for the most part. In your example, the
entire document is probably a single entity.

The primary use of entities is as a kind of macro/shorthand facility.
For example, &lt; is an entity reference; that entity is easier to
remember than the numeric character reference < that would otherwise
be used to enter the less-than character as text. It's possible for a
DTD to define additional entities, which may live either inside your XML
document or be external files.

But since DTDs are being phased out, and Schemas don't support defining
entities, entities are becoming a lot less useful/relevant than they
once were.

Basically: Don't worry about them until you need to worry about them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,008
Messages
2,570,270
Members
46,872
Latest member
Stephendes

Latest Threads

Top