Sure, anything can be validated. The DTD validation enhancement I wrote 
uses the same xml parser as ant, so as long as ant can run, the DTD 
validator can run. (answer to Dmitri's reluctance to add a parser. 
Crimson does the job).

As for checking semantics for XML, a validating parser using XMLSchema 
could do that, provided a schema is available (which is rare today). I 
think it's better to wait until XMLSchema is commonplace (in a year, 
maybe?). Implementing semantic validators would be a complicated 
temporary solution. 

Most tools that read the various generated xml (app servers, servlet 
engines, etc.) perform semantics checks, so we could write testcases 
that use these tools. This requires that the relevant tools be 
available when the tests are run. We can't expect every developer to 
have all the tools (like WLS's ejbc = ejb deployment tool) required to 
run all tests. What we *should* do though, is to commit tests and leave 
the responsibility of running them to the committers that have the 
required test environment. 

Committers of tasks are likely to have the required tools for testing 
them. (I have WLS, and can test weblogis sub task, and that's enough).

:Aslak

----- Original Message -----
From: [EMAIL PROTECTED] (Andrew Stevens)
Date: Wednesday, September 19, 2001 0:57 am
Subject: Re: [Xdoclet-devel] a few bugs in ejb-jar.xml generation

> A wise old hermit known only as  <[EMAIL PROTECTED]> once said:
> 
> > Wouldn't it be nice if the XDoclet core could validate all 
> generated 
> > XML files against a DTD (or XMLSchema for that matter) once it's 
> > generated? This would be great for testing, and we can use 
> xerces (or 
> > any other validating parser) to do the job. We could write JUnit 
> test 
> > cases (accompanied with test data which would be @tagged 
> sources) that 
> > would ensure that XDoclet is always sound! It would result in 
> *way* 
> > better quality of XDoclet. In my opinion this is more important 
> than 
> > anything else. I can contribute with this if there is agreement 
> on it.
> > 
> > Right now, i'm thinking of adding a method to SubTask.java like 
> this:> 
> > validateXml( InputStream xml, InputStream dtd ); 
> > 
> > This method could be called by SubTask subclasses after 
> generating an 
> > xml file, with the possibility to turn validation on/off through 
> ant 
> > parameters.
> > 
> > Comments?
> > 
> > Aslak
> 
> Why stop at only XML?  Anything that's generating a java class 
> (e.g. all 
> the other ejbdoclet subtasks) could validate it by trying to 
> compile it.  
> Of course, that only ensures the syntax is valid and not that it 
> makes 
> sense, but you could say the same for the DDs.  e.g. For a while 
> the BMP 
> beans were getting "<persistence-type>Container<persistence-type>" 
> generated, which while wrong is still valid according to the DTD.  
> I guess 
> more specific test cases could be written to check things like 
> that, 
> though.
> 
> 
> Andrew.
> 
> _______________________________________________
> Xdoclet-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
> 


_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to