Basic XML questions...

U

Unal

Hi,

I have couple of simple questions about XML that I cannot find answers
to in the book I looked at and in the search I did on internet. Can
anyone help me with these?

1- Why is XML case sensitive?
2- Why does not XML allow tag minimization?
3- Why must XML document elements be properly nested?
4- Can you put binary data in a CDATA section?
5- Is there any limit to the length of an element or attribute name?
6- Where do you declare entities?
7- In XML, which takes precedence, the internal DTD or the external
DTD?

TIA,
Unal.
 
R

Richard Tobin

Unal said:
I have couple of simple questions about XML that I cannot find answers
to in the book I looked at and in the search I did on internet.

These do not seem like plausible questions for a real user to ask.
On the contrary, they look just like homework exercises.

In any case, you can find most of the answers in the XML specification
itself.

-- Richard
 
J

Jeff Kish

Hi,

I have couple of simple questions about XML that I cannot find answers
to in the book I looked at and in the search I did on internet. Can
anyone help me with these?

1- Why is XML case sensitive?
2- Why does not XML allow tag minimization?
I don't know.. maybe because XML is an SGML instance?
3- Why must XML document elements be properly nested?
4- Can you put binary data in a CDATA section?
This certainly is answered a zillion places, and even in this newsgroup!..
err after that harangue, I hope this is correct.. yes you can but it has to be encoded to be
valid XML text... sort of like bin2hex does.
5- Is there any limit to the length of an element or attribute name?
Maybe this is implementation dependent.. seems the perfect place to look for an answer is the spec.
6- Where do you declare entities?
7- In XML, which takes precedence, the internal DTD or the external
DTD?
I've never used an internal DTD..
try making a test document and find out.
TIA,
Unal.
HTH
 
P

Peter Flynn

Unal said:
Hi,

I have couple of simple questions about XML that I cannot find answers
to in the book I looked at and in the search I did on internet. Can
anyone help me with these?

Did you try reading the FAQ at http://www.ucc.ie/xml ?
1- Why is XML case sensitive?

So that languages using alphabets which have no case can be used. If we had
allowed case-insensitivity, it would preclude some people from using it.
(Actually it was more complex than that, but it will suffice).
2- Why does not XML allow tag minimization?

To make it easier to write programs for.
3- Why must XML document elements be properly nested?
Ditto.

4- Can you put binary data in a CDATA section?

No. Use UUencoding or Base64 or something like.
5- Is there any limit to the length of an element or attribute name?

In theory, no. In the formal definitions, 999999999 I think. In practice, I
suspect many systems will explode into little pieces of pink goo if you try
to make them read strings longer than their virtual memory maxima.
6- Where do you declare entities?

In the DTD or internal subset.
7- In XML, which takes precedence, the internal DTD or the external
DTD?

The internal subset is read and processed before the external subset.
That way you can include declarations (eg of entities) which will
prevent others of the same name from being used, and thus take precedence.
Many large DTDs use this to allow on-the-fly modifications by overriding
portions of the external subset whose use or non-use is controlled by a
Parameter Entity.

///Peter
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top