Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dita.out.map.htmlhelp.hhk fails to parse maps with <index-see> and <index-see-also> #1

Open
jomjohn opened this issue Aug 9, 2012 · 4 comments
Labels
bug Something isn't working

Comments

@jomjohn
Copy link

jomjohn commented Aug 9, 2012

Here is what the error looks like:

[pipeline] [DOTJ013E][ERROR] Failed to parse the referenced file 'GUID-BCAB1F51-5649-4181-90C3-FD4B35940FF0.ditamap'. The XML parser reported the following error:
[pipeline] org.dita.dost.index.TopicrefElement cannot be cast to org.dita.dost.index.IndexTerm
[pipeline] [DOTJ013E][ERROR] Failed to parse the referenced file 'GUID-1533C78F-50B5-425F-879F-EC518291FDF7.ditamap'. The XML parser reported the following error:
[pipeline] org.dita.dost.index.TopicrefElement cannot be cast to org.dita.dost.index.IndexTerm
[pipeline] [DOTJ013E][ERROR] Failed to parse the referenced file 'GUID-46A3E1DF-F0C4-4911-8F4D-CF1DE4FE140F.ditamap'. The XML parser reported the following error:
[pipeline] org.dita.dost.index.TopicrefElement cannot be cast to org.dita.dost.index.IndexTerm

The following instances result in the dita.out.map.htmlhelp.hhp target not parsing files:

  • The existence of booktitle/keywords/inexterm/index-see (also fails with index-see-also)
  • The existence of map/topicref/topicmeta/keywords/indexterm/index-see (also fails with index-see-also)

Thanks for all of your help!

-Josh Johnson

@robander
Copy link
Member

Verified that this still exists in 2.2.4, with the index parser in general (fails both for HTML Help and Eclipse).

I've updated the old hierarchy.ditamap sample, adding terms into the first branch:

<topicref href="tasks/garagetaskoverview.xml" type="concept">
  <topicmeta>
    <keywords>
      <indexterm>FUZZY</indexterm>
      <indexterm>frizzy<index-see>FUZZY</index-see></indexterm>
    </keywords>
  </topicmeta>
  <topicref href="tasks/changingtheoil.xml" type="task"/>
...

When I build that map to Eclipse, the log contains:

dita.out.map.eclipse.index:
     [echo]  args.eclipsehelp.indexsee = false
 [pipeline] [DOTJ013E][ERROR] Failed to parse the referenced file 'hierarchy.ditamap'.

When I build HTML Help, the log contains:

dita.map.htmlhelp.hhk:
 [pipeline] [DOTJ013E][ERROR] Failed to parse the referenced file 'hierarchy.ditamap'.

In both cases, if I remove the term with the nested <index-see>, the build completes without error DOTJ013E.

@robander
Copy link
Member

robander commented Dec 1, 2017

At this point, with the bug report over 5 years old, I'm skeptical that support for <index-see> or <index-see-also> are going to be added to the older HTML Help and Eclipse output formats. I wonder if at this point it would be enough to ignore them, or possibly add support that doesn't have fancy formatting or attempt to link, rather than having good linking support for see/see-also.

@lief-erickson
Copy link

lief-erickson commented May 26, 2019

I ran into this issue for PDF2/FOP while trying to index the DITA-OT docs, too.

Edit: Used DITA-OT 3.3.1.

@robander
Copy link
Member

I'm getting a new / different failure for Eclipse output now in 3.3.1 based on <index-see> - but it comes from Eclipse specific code. I don't get the same error in HTML Help (which uses a lot of the same code); I don't think any of that code is used for PDF.

For Eclipse in 3.3.1, having exactly the same index-see in two different topics causes the failure -- if two topics each contain this it will fail:

<indexterm>this<index-see>that</index-see></indexterm>
<indexterm>that</indexterm>

The failure in Eclipse comes from this line, though should probably be addressed earlier so that we never get here: https://github.com/dita-ot/dita-ot/blob/develop/src/main/plugins/org.dita.eclipsehelp/src/main/java/org/dita/dost/writer/EclipseIndexWriter.java#L233

When there are 2 identical index-see, we go into a for-loop with a two item list. The list is updated at that line, replaced with a list of children (list size 0). But we continue with the original for-loop, trying to get the second item in the original list, and end up with an "index out of bounds exception" because we're trying to access the second item in a zero-item list.

I'm guessing this should be addressed earlier to ensure that we don't actually have two child items (with topic links) for the index-see but I haven't worked out yet where to do that.

@jelovirt jelovirt transferred this issue from dita-ot/dita-ot Jan 12, 2020
@jelovirt jelovirt added the bug Something isn't working label Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants