Alex Fernández wrote:
> I cannot understand why there can be no DTD. Yes, the contents may be variable and
> extensible, but that's what XML is -- eXtensible.
>
> At least for closed versions, it should be possible to define the grammar used
> therein; otherwise what is the advantage of using XML? Since my experience with it
> is very limited, I'm probably missing something important here.
>
Try to write the DTD entry for a <RequestInterceptor> element (Tomcat 3.2) or a
<Valve> element (Tomcat 4.0) and you will see what I mean. In either case, the Java
class that gets instantiated can be *anything*, with any set of JavaBeans properties.
The initialization logic uses Java reflection to match up XML attributes to JavaBeans
property names at runtime, in the same way that the following JSP statement works:
<jsp:setProperty name="beanname" property="*"/>
Since the set of all possible meaningful property names is infinite, it *cannot* be
enumerated in a DTD, which requires you to list *all* valid attributes of every
element.
NOTE: we still get tremendous advantages from using XML for the configuration files
-- but being able to parse against a DTD is not one of them. We're relying only on
"well-formed" XML, rather than "validated" XML, for the server.xml file.
>
> Cheers,
>
> Alex.
>
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]