David Mundie wrote:
>
> On 2006-Jan-04, at 06:22, Hussein Shafie wrote:
>
>> You did all the hard work, but I didn't manage to test your work simply
>> because you forgot to specify a *document* *template* in your config (if
>> possible, with a local copy of the RISX bibliographic DTD + its
>> associated catalog.xml).
>
> Hussein's comment led me to rethink the whole issue of XXE
> configuration, and I am quite pleased with what I have come up with. I
> think it nicely separates the steps that are really unique to XXE from
> those that are more generally useful.
>
> My version of creating a minimal XXE configuration would be this:
>
> 1. Place your DTD, stylesheets, and document instances anywhere you
> like, tying them together using the normal XML Catalog mechanism. Let
> XXE know where your catalog file resides by placing a link to it
> somewhere in the .xxe/addon subdirectory. (XXE looks here instead of
> using the XML_CATALOG_FILES environment variable.) For example, "ln - s
> `echo $XML_CATALOG_FILES` ." (assuming that your catalog file ends in
> catalog.xml and that it has only one item in it.)
>
> 2. Create a configuration file to point to a document to use as the
> template for new documents. The file might look like this:
>
> <?xml version='1.0' encoding='ISO-8859-1'?>
> <configuration name="Color"
> xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"
> xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration">
>
> <detect>
> <dtdPublicId>-//Anthus//DTD color V1.1.0//EN</dtdPublicId>
> </detect>
>
> <template name="New Color Document" location="file:///Users/
> dmundie/C/XML/color.xml" />
>
> </configuration>
>
> I like this approach because it makes clear that the only really XXE-
> dependent file a user needs to create is the configuration file, which
> is as it should be - everything else is taken care of by the catalog
> mechanism, which can be used by many tools outside XXE. It also gets
> rid of the confusion of copying stylesheets and DTD's into the addon
> directory etc.
>
> If I hadn't been so dense I would have read between the lines of the
> explanation in the configuration guide and realized long ago that I
> could do this, but... better late than never. This approach is so
> simple that I'm confident the next time I have a new document type to
> handle, I actually *will* create a document template. :-)
>
Nice approach. I would just add (if such style sheet exists)
---
<css name="Colored Style Sheet"
location="file:///Users/dmundie/C/XML/color.css" />
---
because, IMHO, adding <?xml-stylesheet?> PIs to XML documents is not
clean. (In fact, in my opinion, adding anything which is not pure
content to an XML document is not clean, even <!DOCTYPE> or
xsi:schemaLocation.)