Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

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

Poorva-25pxJS
Level 2
Level 2

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-Ado.... 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.

6 Replies
DivrajSingh
Employee
Employee

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
Employee
Employee

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>
Poorva-25pxJS
Level 2
Level 2

Thanks @DivrajSingh , that worked. I have a follow up question on associating attributes to topicref. 

If my intended .ditamap is supposed to be like below, should I include chunk as another <li class="chunk">  ?

 

   <topicref chunk="to-content" href="GUID-04f55bfc-d49a-42b9-8104-9b11e769bc7d.dita"><topicmeta/>

      <topicref href="GUID-c039a877-0e74-4057-910d-97ebfe083ce9.dita"/>

      <topicref href="GUID-840b26d4-0c77-4624-a90d-e9f82a7b6da5.dita"/>

   </topicref>

   <topicref chunk="to-content" href="GUID-0142a9f6-282b-4f44-9de6-0c1e1cba873b.dita"><topicmeta/>

      <topicref href="GUID-e5539249-a4c2-44a6-8542-b643f5e36f0a.dita"/>

      <topicref href="GUID-10c3053d-f4e1-441c-9e37-25593da33ce5.dita"/>

   </topicref>

 

 

Poorva-25pxJS
Level 2
Level 2

Hi @DivrajSingh , @Kiran_Mohan 

Just adding to the thread above.

  • I wanted to understand if additional attributes like chunk=“to-content” can be added to the topicref in the ditamap. If yes, then how should this be included in the index.html so that the ditamap is generated accordingly. 
  • I have another query with respect to ditamap generation via index.html. How should I update the index.html so that the ditamap is generated with the followimg attributes -
    • format

    • topic

    • href

DivrajSingh
Employee
Employee

@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.

Poorva-25pxJS
Level 2
Level 2

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.