文書型 > Porting Document Types > Converting XML and SGML Document Types
  
Converting XML and SGML Document Types
You can use Arbortext Architect to convert XML DTDs to SGML, and SGML DTDs to XML.
To convert an SGML DTD to an XML DTD:
1. Open Arbortext Architect.
2. Choose File > Open.
3. Locate the directory in which the document type you want to validate is located, and then click Select.
4. Choose Compile > XML Application.
Arbortext Architect will ask you to confirm that you want to convert the document type. If you confirm, Arbortext Architect will add the XML PI to the beginning of the DTD and recompile it. If the compile is successful, Arbortext Architect will update the test document instances to include the XML PI and rename the test documents to have an .xml extension.
Arbortext Architect will not attempt to make additional changes to the DTD. For example, it will not update external entity references with system identifiers (as is the custom with XML documents). Such modifications must be performed manually by the document designer.
To convert an XML DTD to an SGML DTD:
1. Open Arbortext Architect.
2. Choose File > Open.
3. Locate the directory in which the document type you want to validate is located, and then click Select.
4. Choose Compile > SGML Application.
Arbortext Architect will ask you to confirm that you want to convert the document type. If you confirm, Arbortext Architect will remove the XML PI from the beginning of the DTD and recompile it. If the compile is successful, Arbortext Architect will update the test document instances to remove the XML PI and rename the test documents to have the proper extension (.sgm or .htm).
* 
If the top-level tag in the DTD is html, or if the Public ID for the DTD contains “HTML”, the test documents will be given an .htm extension. Otherwise the extension will be .sgm.