[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Ignoring a DTD with document()
Hi Mark,
DTDs are special, compared to other schema languages, in that they allow entity declarations that need to be resolved during parsing. Saxon's -dtd option only controls whether the document be validated against the DTD *after* it has been successfully parsed. If the document does not use any named character entities, the second-best option is to remove the DOCTYPE declaration altogether. But then you can't have content completion and validation any more for that document. In Oxygen, where you can find out where the DITA OT ancillary files reside, you can supply a project-specific XML catalog that will resolve any system identifier that ends with 'reference.dtd' to one of the available framework files, such as C:\Program Files\Oxygen XML Editor 26\frameworks\dita\DITA-OT\plugins\org.oasis-open.dita.v1_3\dtd\technicalContent\dtd\reference.dtd Create a catalog file like this, using systemSuffix and a file URI that points to the framework DTD: <?xml version="1.0" encoding="UTF-8"?> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <systemSuffix systemIdSuffix="dita-oasis/1.2/technicalContent/dtd/reference.dtd" uri="file:///C:/Program%20Files/Oxygen%20XML%20Editor%2026/frameworks/dita/DITA-OT/plugins/org.oasis-open.dita.v1_2/dtd/technicalContent/dtd/reference.dtd"/> </catalog> I noticed that the document requests a DITA OT 1.2 DTD so I didn't just map any system identifier that ends with 'reference.dtd' to the 1.3 location given above. Instead I said that if the system id ends with 'dita-oasis/1.2/technicalContent/dtd/reference.dtd' (notice the use of forward slashes despite the backslashes found in the input document), it should resolve to the 1.2 reference.dtd. If you use Oxygen's .xpr files, store the catalog file in the directory that the .xpr file resides in, for example, locate the 'XML Catalog' entry in the Preferences dialog and add a project-specific entry ${pdu}/mycat.xml that points to the newly created catalog. Of course, if you don't use projects, you can store it anywhere on disk and use the absolute path to the new catalog file as a global option. Then the following (and your) document should parse (and validate) against the DITA OT 1.2 reference DTD that ships with Oxygen: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE reference PUBLIC "PUBLIC IDENTIFIER" "D:\DocTypes\dita-oasis\1.2\technicalContent\dtd\reference.dtd"> <reference id="d"> <title></title> </reference> HTH, Gerrit On 21.04.2024 04:06, Mark Giffin m1879@xxxxxxxxxxxxx wrote: Thanks Michael,
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|