Content import for HTML content to create a .ditamap creates a .dita file instead | Community
Skip to main content
Level 2
July 27, 2021

Content import for HTML content to create a .ditamap creates a .dita file instead

  • July 27, 2021
  • 1 reply
  • 3401 views

Issue:
Each time I define a table of content in an index.html  and try a HTML document migration it ends up creating a topic .dita instead of the expected .ditamap .

AEM Instance:
AEM 6.5 + SP7 + SP8 + XML Add On v3.8

Issue Description:
Followed the steps from Migrate XHTML documents section of the document https://helpx.adobe.com/content/dam/help/en/xml-documentation-solution/3-8/XML-Documentation-for-Adobe-Experience-Manager_Installation-Configuration-Guide_EN.pdf. According to the docs here, to generate the ditamap you need to include the 
index.html inside a zip file, which includes links to the other files. Also, define the <ul> and <li> tags with attributes as per recommendation.
However, the dita file that finally gets created from the index.html is a DITA topic with an extension of .dita.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

DivrajSingh
Adobe Employee
Adobe Employee
July 29, 2021

The steps you defined seems correct and we validated the functionality on XML Documentation v3.8 - and it works as expected.

Will it possible for you to share the sample content zip?

Or you can raise a support ticket with the sample package.

DivrajSingh
Adobe Employee
Adobe Employee
July 29, 2021

Also do make sure the HTML heading does not include any namespaces, a sample HTML header would be:

<?xml version="1.0" encoding="UTF-8"?>

<html xmlns=http://www.w3.org/1999/xhtml>

 

With all the rules catered, the sample index.html will look like:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Index File</title>
	</head>
	<body>
		<h1>Index File (this will be ditamap title)</h1>
		<div class="content">
			<ul class="book">
				<li class="topicref"><a href="link1_file_path.html">link1_file</a></li>
				<li class="topicref"><a href="link2_file_path.html">link2_file</a>
					<ul class="book">
						<li class="topicref">
							<a href="link3_file_path.html">link3_file</a>
						</li>
						<li class="topicref">
							<a href="link4_file_path.html">link4_file</a>
						</li>
					</ul>
				</li>
			</ul>
		</div>
	</body>
</html>
Level 2
August 31, 2021

@poorva-25pxjs: for this you need custom rules in h2d_extended.xsl. Add the attributes to source html - read those in XSL to generate desired dita output.


Hi @divrajsingh , @kiran_mohan 
I was able to get the additional attributes (format, topic, chunk) added to the ditamap by making changes to /etc/fmdita/html2dita/toc2map.xsl

What would be the right approach to override this file? I tried an override at  /apps/fmdita/config/html2dita/toc2map_extended.xsl but that didn't quite work.