Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311217

Summary: [Help] New Child macro does not pick-up child topics at the toc level - Fix for Eclipse 3.6.1
Product: [Eclipse Project] Platform Reporter: Hadar Hawk <hadar>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cgold
Version: 3.6   
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test case
none
toc file with href in the toc element to a file with the child macro
none
html file with the child macro code
none
Patch none

Description Hadar Hawk CLA 2010-04-30 13:19:38 EDT
Build Identifier: SDK 3.6M6

The child macro added in (190467) works great if the toc.xml file has the children listed there.  But, we have toc.xml files with anchors and other files anchor into them and the child macro does not work.

So, we have a toc file: (test_toc.xml)
<toc label="Testing" topic="test.html">
   <anchor id="test_general"/>
   <anchor id="test"/>
   <anchor id="test_extra"/>
</toc>

and another toc file:
<toc label="******" link_to="test_toc.xml#test" topic="mytopic.html">
   <topic label="Anchored child 1" href="topic1.html"/>
   <topic label="Anchored child 2" href="topic2.html"/>
</toc>

the test.html file from the first toc file contains:
<div><p>start links:<br/><!--INSERT_CHILD_LINKS--></p></div>

but no children are displayed.

Reproducible: Always

Steps to Reproduce:
use files from the details.
Comment 1 Chris Goldthorpe CLA 2010-04-30 14:39:47 EDT
Created attachment 166660 [details]
Test case

I just tried this with the attached test case and it works fine for me.
Comment 2 Chris Goldthorpe CLA 2010-05-07 20:21:11 EDT
I'm closing this as it worked when I tried it. If you have an example that fails please reopen the bug and attach a zip of the bundle(s) which show the problem.
Comment 3 Hadar Hawk CLA 2010-05-19 16:33:58 EDT
It does not work when you have the href on the toc entry in the toc.xml file and the href contains the child macro comment.

toc.xml
-----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>

<toc label="Anchored Toc" topic="html/toc.html">
   <topic label="Getting Started">
      <anchor id="gettingstarted"/>
   </topic>
...
----------------------------------------------------------------------

toc.html file
-------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>Table of Contents</title>
</head>

<body>
<h1>Table of Contents</h1>
Please enter your text here.
<div><p>start links:<br/><!--INSERT_CHILD_LINKS--></p></div>
</body>
</html>
Comment 4 Hadar Hawk CLA 2010-05-19 16:36:29 EDT
Created attachment 169215 [details]
toc file with href in the toc element to a file with the child macro
Comment 5 Hadar Hawk CLA 2010-05-19 16:36:51 EDT
Created attachment 169216 [details]
html file with the child macro code
Comment 6 Chris Goldthorpe CLA 2010-05-19 19:00:52 EDT
I can see the problem now, it has nothing to do with anchors, it is failing in the page is linked to the toc. This is too late for 3.6, targeting 3.6.1.
Comment 7 Chris Goldthorpe CLA 2010-06-03 16:28:49 EDT
Created attachment 171019 [details]
Patch
Comment 8 Chris Goldthorpe CLA 2010-06-25 17:06:32 EDT
Patch applied to 3.6 maintenance stream, Fixed