You may gain a little for a little more consistence but you loose a lot in error
report. You do not use the capability of XML DTD to validate an XML file.
Also I don't think thye constistence argument hold a lot.
The description field is a complex object (in that case - a multiline String -
-probably rich text) that is best represented by an element. But the Reentrant
attribute is a simple object (true or false) that is best represented by an
attribute.
I have a question for you. In your java program, do you use a base type to represent
a boolean value or the Boolean object to represent the same value. If you wich to be
constistent he will use Objects all over the place and never use base type. One may
gain in consitency by doing this but will loose in effeciency also. The Java APIs do
not use Objects all over the place for the sake of consistency.
This is the same for XML, by making eveything an element you gain in concistency, but
you loose in effeciency, elegance and error validation.
If you really want to use only elements, go for it but at least for something like
the reentrant attribute do something like this:
<!ELEMENT Reentrant (False|True)>
<!ELEMENT False EMPTY>
<!ELEMENT True EMPTY>
That way at least you will gain a little in validation. But again you loose on
effeciency because the resulting DOM tree will be a lot bigger.
Vlada Matena wrote:
> Use of attributes seemed attractive at first. But some information could not be
> expressed as attributes so we switched to using elements for everything to
> be consistent.
>
> Vlada
>
> ----- Original Message -----
> From: Rickard �berg <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, May 16, 1999 1:17 AM
> Subject: Re: EJB1.1 first thoughts
>
> Emmanuel Pirsch wrote:
> > I've read the DTD from the 1.1 Spec, it's a real mess. Everything is elements
> > It seems that they did not want to use attributes for simple things like the
> > "reentrant" element (for wich the DTD allow one to put anything in it even if
> > the allowed value should only be "True" or "False").
>
> I don't agree. Consider the following:
> If Reentrant is an attribute of the Entity element it would make sense
> to have Description as an attribute too. But since it should be possible
> to have multiline Description's this aint possible (attributes are
> always normalized..). So then some "atteibutes" of Entity would be
> XML-attributes and some would be XML-elements, and that would be a real
> mess. Hence it is better to be consistent and use elements for all info.
> IMHO of course.
>
> > This will make it more difficult to write GUI for editing the DTD. Also valid
> > XML DD produce with this DTD may contains error that would be easily avoided by
> > using attributes instead of elements when it's appropriate.
>
> I'm almost done with a JavaBean based, extensible, OpenSourced,
> Swing-ified EJB1.1 XML editor. It was not that hard IMHO.
>
> Just my 2 cents...
>
> /Rickard
>
> --
> Rickard �berg
>
> Computer Science student@LiTH
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> Homepage: http://www-und.ida.liu.se/~ricob684
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
--
-----
Emmanuel Pirsch
Sun Certified Java Programmer
Unite for Java! - http://www.javalobby.org/
---
"The intuitive mind is a sacred gift and the rational mind is a faithful servant. We
have created a society that honors the servant and has forgotten the gift."
- Albert Einstein.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".