Roberto Rosselli Del Turco wrote:
> 
> Hussein Shafie wrote:
> > This is explained in the Power User's Guide. See
> > http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s01s01.html
> 
> sorry to bother you again, but I'd really appreciate if you could point
> me to the section in the poweruser guide explaining how to automatically
> associate a DTD to a document without a <!DOCTYPE> (and, if possible,
> some examples). Unless you've already done that and I just don't
> understand what the guide says :)

Find attached to this email a *skeleton* of a XXE configuration for TEI
Lite (the CSS style sheet is *missing*).

To install this patch, unzip it in order to patch the config/
subdirectory of your XXE distribution directory. For example, if you
have installed XXE on C:\Program Files\XMLmind_XML_Editor, ``extract''
teilite_config_patch.zip in this directory.

This patch:

1.Creates config/teilite/. 
2.Adds an entry for TEI Lite to config/catalog.xml. 

config/teilite/teilite.xxe is a configuration file that ``declares'' TEI
Lite documents to XXE.

teilite.xxe
---------------------
<?xml version='1.0' encoding='ISO-8859-1'?>
<configuration name="TEI Lite"
 
xsi:schemaLocation="http://www.xmlmind.com/xmleditor/schema/configuration
                      ../configuration/xsd/configuration.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns="http://www.xmlmind.com/xmleditor/schema/configuration";
  xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration";>

  <detect>
    <and>
      <or>
         <rootElementLocalName>div1</rootElementLocalName>
         <dtdPublicId>-//TEI P4//DTD Main DTD Driver File//EN</dtdPublicId>
      </or>
      <rootElementNamespace xsi:nil="true" />
    </and>
  </detect>

  <dtd publicId="-//TEI P4//DTD Main DTD Driver File//EN" 
       systemId="dtd/teixlite.dtd" />

  <template name="Document" location="template/document.xml" />
  <template name="Chapter (part of a master document)" 
            location="template/chapter.xml" />

<!-- TODO
  <css name="TEI Lite" location="css/teilite.css" />
-->

</configuration>
---------------------
What follows is an explanation element by element.


--------------------
  <detect>
    <and>
      <or>
         <rootElementLocalName>div1</rootElementLocalName>
         <dtdPublicId>-//TEI P4//DTD Main DTD Driver File//EN</dtdPublicId>
      </or>
      <rootElementNamespace xsi:nil="true" />
    </and>
  </detect>
--------------------
The above <detect> clause reads like this:
IF the name of the root element is div1 [[A]]
OR 
IF the document has a <!DOCTYPE> with a "-//TEI P4//DTD Main DTD Driver
File//EN" publicId [[B]]
AND 
IF the name of the root element has no namespace [[C]],
THEN
the document being loaded is a TEI Lite document, apply the
configuration teilite.xxe to it.

Condition [[A]] detects <!DOCTYPE>-less TEI Lite documents. You can add
more clauses like that if you want (example:
<rootElementLocalName>div0</rootElementLocalName>).

Condition [[B]] detects TEI Lite documents with a proper <!DOCTYPE>.

Ignore [[C]] which is a low-level detail.




--------------------
  <dtd publicId="-//TEI P4//DTD Main DTD Driver File//EN" 
       systemId="dtd/teixlite.dtd" />
--------------------
This attaches a DTD to <!DOCTYPE>-less documents detected as being TEI
Lite by the means of the above <detect> clause.



--------------------
  <template name="Document" location="template/document.xml" />
  <template name="Chapter (part of a master document)" 
            location="template/chapter.xml" />
--------------------
Defines 2 document templates.

First template called "Document" has a <!DOCTYPE> declaration which
points to http://www.tei-c.org/TEI/Lite/DTD/teixlite.dtd but thanks to
the XML catalog (a different concept which complements XXE
configurations), XXE will not download the TEI Lite DTD from
www.tei-c.org.

Second template called "Chapter (part of a master document)" has no
<!DOCTYPE> declaration and is detected as being TEI lite by the means of
the above <detect> clause.




--------------------
<!-- TODO
  <css name="TEI Lite" location="css/teilite.css" />
-->
--------------------

Is the future declaration of a CSS style sheet for TEI Lite documents.
For now, it is commented out.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: teilite_config_patch.zip
Type: application/x-zip-compressed
Size: 10281 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20030217/a3be5555/attachment.bin
 

Reply via email to