|
From: JP P. <jp....@ti...> - 2003-05-30 08:38:14
|
Rod, - Juergen has advanced on DTD retrieving. - I will try to examine the behavior of the code. - Mappings Yes, what I made is the more stupid. Nevertheless, I didn't see that our DTD doesn't solve the main issue in our xml file. It will be very difficult to explain why a property style comes in the middle of the xml. This irritate me and will surely provoquing a bunch of criticisms. XMl can aceept it, but not understand. Imagine that a user will not have an equality sign in a line or have many or if lines were assembled. In all these cases, the document will be valid! It's not clean, we have to rest in a unique logic even if it's a little more verbose. My proposal is to create a third subelement of property, saying map, not mixable with others. <property name=3D"mappings"> <map key=3D"/welcome.html">pagedListController</value> <map key=3D"/detail.html">pagedListController</value> </property> And in the DTD <!ELEMENT property ((value | ref)+ | map+)> ... <!ELEMENT map (#PCDATA)> <!ATTLIST map key CDATA #REQUIRED > > -----Message d'origine----- > De : spr...@li...=20 > [mailto:spr...@li...] > De la part de Rod Johnson > Envoy=E9 : vendredi 30 mai 2003 09:49 > =C0 : JP Pawlak; spr...@li... > Objet : Re: [Springframework-developer] DTD >=20 >=20 > JP, >=20 > Thanks for this. And thanks for putting the DTD on your=20 > website so we can test PUBLIC. >=20 > Yes, all files use the same DTD. It's also possible to use a=20 > standalone bean factory (for example in a Swing app or=20 > command-line app). >=20 > You're correct: I forgot the singleton attribute. Optional,=20 > default is "true". I'll add this tonight. >=20 > Either class or parent att is required. Unfortunately I don't=20 > think DTD allows this kind of control. The class attribute=20 > will be "inherited" from ancestor definitions. This is useful=20 > when one bean's properties are used as a basis for other definitions. >=20 > We need a definitive home for the DTD, but I guess that will=20 > be part of the website. However, there must be a fallback=20 > option so that users can validate without being online (this=20 > can be a big irritation). >=20 > I still can't get proper validation, even against your public=20 > DTD. I'm using the following code: >=20 > DocumentBuilderFactory factory =3D = DocumentBuilderFactory.newInstance(); > factory.setValidating(true); > DocumentBuilder db =3D factory.newDocumentBuilder(); > Document doc =3D db.parse(is); >=20 > One note about your changed XML file: >=20 > Your change to map properties is over-enthusiastic: >=20 > <property name=3D"mappings"> > <value>/welcome.html=3DpagedListController</value> > <value>/detail.html=3DpagedListController</value> > </property> >=20 > This is only one value, parsed by the relevant PropertyEditor: >=20 > <value> > /welcome.html=3DpagedListController > /detail.html=3DpagedListController > </value> >=20 >=20 > Thomas, Isabelle: >=20 > I agree about breaking compatibility now. I would like to=20 > enforce validation in all cases, but we'd have to solve how=20 > to get the DTD locally. >=20 > Regards, > Rod >=20 >=20 > ----- Original Message ----- > From: "JP Pawlak" <jp....@ti...> > To: "'Rod Johnson'" <rod...@in...>;=20 > <spr...@li...> > Sent: Friday, May 30, 2003 2:34 AM > Subject: RE : [Springframework-developer] DTD >=20 >=20 > Hi Rod, >=20 > First, some remarks: > - You have changed the attribute of ref elements from refid=20 > to bean. It's better, but has to be noticed. > - It seems you forgot the singleton attribute. I don't=20 > remember its default value. It will be better set the DEFAULT=20 > in the DTD. > - Can really the class attribute be omitted for beans? > - Where should be the DTD? Clearly somewhere in the jar.=20 > Perhaps in a ressource directory. I don't remember what is to=20 > do to retrieve locally a PUBLIC DTD. As we have no official=20 > URI to put the DTD, I have put the attached one on my=20 > personal site for testing PUBLIC DOCTYPE. But is it possible=20 > to put our DTD somewhere in SourceForge? > - Should we require all XML files to be valid. > * For this one, the DOCTYPE should only be used for files=20 > using the new syntax. The files whithout the DOCTYPE will=20 > only be checked for well forming. > * For now, we have only the applicationContext and the=20 > servlet-definition in XML. Both are using the same DTD. Have=20 > I missing somewhat? >=20 > I have transformed the old pagedlist bean definition to the=20 > new syntax as it was the smallest I have. I tested it against=20 > the DTD as SYSTEM and PUBLIC with XmlSpy. I have attached the=20 > two files to this mail. >=20 > Regards, > Jean-Pierre >=20 >=20 > > -----Message d'origine----- > > De : spr...@li... > > [mailto:spr...@li...] > > De la part de Rod Johnson > > Envoy=E9 : jeudi 29 mai 2003 23:49 > > =C0 : spr...@li... > > Objet : [Springframework-developer] DTD > > > > > > I knew I forgot some further questions: > > > > - Where should the DTD go? > > - Should we require all XML files to be valid? > > > > - How long should I retain the present backward compatibility in=20 > > parsing XML? 0.8? 0.9? Break it now? > > > > Regards, > > Rod > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: eBay > > Get office equipment for less on eBay!=20 > > http://adfarm.mediaplex.com/ad/ck/711-11697-> 6916-5 > > > > _______________________________________________ > > > > Springframework-developer mailing list=20 > > Spr...@li... > >=20 > https://lists.sourceforge.net/lists/listinfo/s> pringframework-developer > > >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: eBay > Get office equipment for less on eBay!=20 > http://adfarm.mediaplex.com/ad/ck/711-11697-> 6916-5 >=20 > _______________________________________________ >=20 > Springframework-developer mailing list=20 > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 |