extensibility

Importing SGML Document Type Definitions


XML Authority can import SGML DTDs for conversion to XML schemas. XML doesn't support all of the capabilities of SGML DTDs, but XML Authority uses a sophisticated set of rules to include as much of the information provided in the SGML DTD as possible.  If information provided in the SGML DTD cannot be included, it is reported in the Errors pane.  The detailed rules used by XML Authority (for handling SGML usage outside of XML's capabilities) are presented at the bottom of this document.

To import an SGML DTD, select the SGML DTD option from the Import submenu of the File menu. The dialog box shown in Figure A will ask you to locate the SGML DTD. Select the file, and click the Open button.

Importing SGML - file selection

Figure A - Selecting an SGML DTD to import

XML Authority will then load and parse the DTD, converting it to XML internally and presenting a list of errors (shown below in Figure B), if there are any. Errors marked with red selectors are problems that will need manual correction - the declaration arrived without a complete set of information that can be used by XML. Yellow selectors indicate problems that XML Authority was able to correct, though they may have required minor modifications to the imported information. Green selectors are informational, indicating problems that XML Authority has already fixed, typically the use of SGML data types that XML doesn't support. In these cases, though there has been a change, the schema developer shouldn't need to make any modifications.

Importing SGML - error reporting

Figure B - Error reporting for a typical large SGML DTD

You can click on the errors shown in the error pane to modify the original source when appropriate. Clicking on the error message will take you to the source of the error. If the error was an error on import, you'll be able to edit the original imported material and reparse it. (The header in the file will indicate that the material you are editing is "Original Source" from an import.)

When you have finished correcting errors, you can return to the other panes of XML Authority and begin editing your DTD, as shown below in Figure C.

Importing SGML - file selection

Figure C - Editing the DTD in XML Authority

SGML Accommodations

  1. XML Authority ignores tag requirement syntax, i.e., - - and - o and o o and O - between element name and its content model. Notice that both l/c and u/c 'o' and 'O' are accepted.
  2. XML Authority replaces the AND connector & with a choice connector '|' in content models.
  3. XML Authority accomodates pe/ge references not ending in ';' by simply noting their absence
  4. XML Authority accomodates aggregated element declarations
  5. XML Authority accomodates aggregated attlist declarations
  6. XML Authority accomodates the additional attribute types NUMBER as CDATA
  7. XML Authority accomodates the additional attribute types NUTOKEN(S), NAME(S) as NMTOKEN(S)
  8. XML Authority accomodates a content model of RCDATA, CDATA as PCDATA
  9. XML Authority handles inclusion/exclusion in content model by ignoring it
  10. XML Authority accomodates a space between '&' and entity name
  11. XML Authority accomodates a space between '%' and entity name
  12. XML Authority accepts -- delimited comments before end of all declarations... but only at end
  13. XML Authority accepts (and ignores) SDATA within entity declarations. XML Authority issues a warning if of the form [xxx].
  14. XML Authority accepts CONREF and CURRENT as attribute defaults. They are converted to IMPLIED.
  15. XML Authority ignores #NOTATION and any other special attribute declarations.
  16. XML Authority makes #FIXED #CONTENT attributes #REQUIRED and places the content info into the comment.
  17. XML Authority accomodates prefixes before ge: CDATA, SDATA, PI, STARTTAG, ENDTAG, MS, MD.
  18. XML Authority accomodates SUBDOC | CDATA notation | SDATA notation after external general entity declaration.
  19. #DEFAULT is currently being detected and thrown as a general entity name.

Copyright 2000 Extensibility, Inc.

Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516