Excellent proposal! I am thinking along this line but you beat me to it. Elements
and attributes should be complementary, not mutually exclusive. The only advantage
of using elements compared to attributes I can see is that it facilitates
"searching": it is easier to look up elements. This is easily done using DOM's
getElementsByTagName method. In DOM Level 2, there is also a Filter interface which
you can use to implement element filters.

Emmanuel Pirsch wrote:

> <stuff deleted>
> For example, the current DTD specifies the <Reentrant> element like this:
> <!ELEMENT reentrant (#PCDATA)>
>
> Here is an example of how it will looks like in a xml document:
> <entity>
>     <reentrant>False</reentrant>
> </entity>
>
> With the current proposition it will be specified like this:
> <!ELEMENT reentrant EMPTY>
> <!ATTLIST reentrant
>     value (True | False) "True"
> >
>
> Here is an example of how it will looks like in a xml document:
> <entity>
>     <reentrant value="False"/>
> </entity>
>
> Note that values that are not multiline (like class name) should be specified
> the same way.
> <!ELEMENT ejb-class EMPTY>
> <!ATTLIST ejb-class
>     value CDATA #required
> >
>
> By using this approach, we keep the consistency argument, everything is an
> element.But we have the added value that we can specify a domain for each value
> that requires one.
>
> Also the code that read the document will be cleaner, with DOM it take less
> steps to read a attribute value than a text-node.
>
> Another thing to change would be to put all the element in a namespace
> ("ejb-dd" for example).
>
> I hope this new idea will stimulate the discussion in a constructive way.
>
>     SeeU!
>
> -----
> 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".

===========================================================================
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".

Reply via email to