Hussein Shafie wrote: > Manuel Collado wrote: >> As DTDs and CSSs are not XML documents, and hence they can't be edited >> with XXE, it's worth to have external validation facilities for this stuff. >> >> Is it possible to call some XXE Java code from the command line in order >> to validate a DTD or CSS file alone?. >> >> I'm aware of 'dtdvalid', but in fact it validates an XML document >> against its DTD. It validates also the DTD, but to validade the DTD >> alone we are forced to write some dummy XML document. > > You are not forced to write a dummy XML document. Simply use "dtdvalid > -d dtd_file".
Thank you for the hint. I've tried it, and works. By the way, a minor inconsistency is that the given diagnostic messages seem to count lines starting from 1, but columns starting from 0. Most text editors don't do so, but count columns also from 1. > > For XML Schemas, use "xsdvalid -s schema_file". (xsdvalid is included in > Standard Edition.) > >> A similar facility for CSS validation seems to be missing. > > Of course, we have such command line utility for our non-regression > tests. But this command line utility is not included in XXE distribution. What is a pity. I'm using a customizable text editor to edit DTD/CSS files. When editing a DTD, the editor allows me to call an external command-line validator, capture the output, parse it, and set the cursor on the offending element by simply clicking on the diagnostic message. It's frustrating not to been able to do so for CSSs. Please consider making available this facility. I assume the required code is already part of the XXE distribution, because a pop-up window shows the diagnostic messages when trying to use an invalid CSS. > > What is important when writing a CSS is to see if the document looks > good with it. In order to do this, open a test document in XXE and after > modifying the CSS, reload the modified CSS by simply selecting its name > from the Style menu. That's what I do. But let me disagree about that "looking good" is enough. When preparing a CSS to WYSIWYG edit an XML document it is very important that styling rules will be applied as intended. So it's very helpful to be informed about not supported or specially handled CSS features and other errors *before* trying to apply them to a sample XML document. > >> I'm using XXE Standard Edition. Are the mentioned facilities available >> in the Professional Edition? > > Professional Edition has no additional utilities. > Thank you for your quick response, -- ------------------------------------------------------------------------ Manuel Collado Machuca | Facultad de Informatica UPM Universidad Politecnica de Madrid | Campus de Montegancedo Dep. LSIIS | Boadilla del Monte Tel.+34-91-336.74.57 Fax.+34-91-336.74.12 | 28660 MADRID - SPAIN ------------------------------------------------------------------------

