Document file extension and media type
This topic shows an example on how to set the document file extensions and the media types. This example consists of the following steps:
-
Set
.xml
as the default file extension andtext/xml
as the default file media type. -
Set .
ditamap
extension andapplication/dita+xml
media type for documents with themap
element as root element. -
Set .
dita
extension for documents with thetopic
element as root element.
Step 1
Set .xml
as default extension and as default media type.
Add the default
and default
attributes to the document
element.
text/xml
is the default media type for human readable XML.
Your document
should now look like this:
XML
<documentProcessing xmlns="http://schemas.fontoxml.com/connectors/2.0/documentProcessing.xsd">
<!--Configure the extension for documents-->
<documentFileExtension defaultExtension="xml"defaultMediaType="text/xml"/>
<!--Configure the title for documents-->
<documentFilename defaultFilename="Untitled document"/>
<!--Configure the path rewriting-->
<pathRewriting>
</pathRewriting>
</documentProcessing>
Step 2
Set the .ditamap
extension and application/dita+xml
media type for documents with the map root element.
-
Add a
file
element with attributeExtension extension="ditamap"
and attributemedia
Type="application/dita+xml "
inside thedocument
element.File Extension -
Add a
root
element with attributeElement name="map"
inside thefile
element you have just created.Extension
Your document
should now look like this:
XML
<documentProcessing xmlns="http://schemas.fontoxml.com/connectors/2.0/documentProcessing.xsd">
<!--Configure the extension for documents-->
<documentFileExtension defaultExtension="xml" defaultMediaType="text/xml" >
<fileExtension extension="ditamap" mediaType="application/dita+xml"><rootElement name="map"/></fileExtension>
</documentFileExtension>
<!--Configure the title for documents-->
<documentFilename defaultFilename="Untitled document"/>
<!--Configure the path rewriting-->
<pathRewriting>
</pathRewriting>
</documentProcessing>
Step 3
Set the .dita
extension for documents with the topic element as root element.
-
Add a
file
element with attributeExtension extension="dita"
inside thedocument
element.File Extension -
Add a
root
element with attributeElement name="topic"
inside thefile
element you have just created.Extension
Your document
should now look like this:
XML
<documentProcessing xmlns="http://schemas.fontoxml.com/connectors/2.0/documentProcessing.xsd">
<!--Configure the extension for documents-->
<documentFileExtension defaultExtension="xml" defaultMediaType="text/xml" >
<fileExtension extension="ditamap" mediaType="application/dita+xml">
<rootElement name="map"/>
</fileExtension>
<fileExtension extension="dita"><rootElement name="topic"/></fileExtension>
</documentFileExtension>
<!--Configure the title for documents-->
<documentFilename defaultFilename="Untitled document"/>
<!--Configure the path rewriting-->
<pathRewriting>
</pathRewriting>
</documentProcessing>
Many more variations can be created to configure Fonto Connectors to suit your needs. You should now have enough knowledge to configure the file extensions and media types.