Subject: Re: Why Doesn't IE5 use the DTD to Validate? From: Sara Mitchell <smitchel@xxxxxxxxxx> Date: Thu, 01 Apr 1999 09:37:21 -0800 |
Not absolutely. There is at least one area where it could be a benefit to parse the DTD but not validate the document: you define standard general entities in the DTD which you want to be available to every document of that type but you need to control their content from a single point. Documents within that type may or may not use any of these general entities. However, XML parsers are not required to parse out general entities defined in an external DTD. The other way to do this is not quite as clean, but its guaranteed to work: you define a standard general entity and also use it in the internal subset of any document of that type. This works as long as you have control of who authors documents of this type -- or you warn any potential authors in documentation or comments in the DTD that certain feature will only work if they include that general entity in the internal subset. To demonstrate, say I have three standard entities like this: <!ENTITY % product "My Product Name"> <!ENTITY % version "1.0"> <!ENTITY % copyright SYSTEM "./copyright.xml"> If I put them in the DTD and then authors use them in documents, it depends on how the XML parser treats the DTD and the entity declarations. You may get "undefined entity" errors. This works in SGML because SGML parsers always expand general entities. The work around that I have started using is to define these entities in a single file, say Stdent.xml, and then include this declaration and use within the internal subset of any document: <?xml version="1.0"?> <!DOCTYPE Mydocs SYSTEM "/mydocs.dtd" [ <!ENTITY common SYSTEM "./Stdent.xml"> &common;] <Mydocs> ... Sara Marcus Carr wrote: > > Didier PH Martin wrote: > > > a) for rendition in browsers validation is overkill and not really > > necessary. We have to reduce publication frictions > > b) for information exchange like business to business transactions (i.e. > > EDI) validation becomes necessary to prevent the "garbage in" problem to ERP > > systems. > > > > Thus, these two distinct XML usages requires different way to process (i.e. > > parse) the documents. Its simply a matter of choosing the right stuff for > > the right occasion :-) > > Perhaps I'm missing something here, but I understood that IE5 does process the > DTD, it just doesn't validate the instance. Under what circumstances is it > beneficial to process the DTD but then not apply the logic to the instance? Is > processing the DTD not an overhead without benefit? > > -- > Regards, > > Marcus Carr email: mrc@xxxxxxxxxxxxxx > ___________________________________________________________________ > Allette Systems (Australia) www: http://www.allette.com.au > ___________________________________________________________________ > "Everything should be made as simple as possible, but not simpler." > - Einstein > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Why Doesn't IE5 use the DTD to, Didier PH Martin | Thread | RE: Why Doesn't IE5 use the DTD to, David Schach |
RE: Why Doesn't IE5 use the DTD to, John Dreystadt | Date | Re: Why Doesn't IE5 use the DTD to, Jeff Greif |
Month |